Package com.graphaware.common.transform
Interface IdTransformer<ID,E extends Entity>
-
- Type Parameters:
ID
- custom ID type.E
- entity type.
- All Known Subinterfaces:
NodeIdTransformer<ID>
,RelationshipIdTransformer<ID>
- All Known Implementing Classes:
BaseIdTransformer
,BaseTrivialIdTransformer
,TrivialNodeIdTransformer
,TrivialRelationshipIdTransformer
public interface IdTransformer<ID,E extends Entity>
A transformer of custom IDs to and from internal Neo4jEntity
IDs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ID
fromEntity(E entity)
Transform an internal Neo4j node ID of aEntity
to a custom ID.long
toGraphId(ID id)
Transform a custom ID to internal Neo4j ID.
-
-
-
Method Detail
-
toGraphId
long toGraphId(ID id)
Transform a custom ID to internal Neo4j ID.- Parameters:
id
- to transform. Can benull
, which represents a new entity not yet persisted to the database.- Returns:
- internal Neo4j ID.
DetachedEntity.NEW
should be returned in case the id parameter isnull
.
-
-