public class MappingContext extends Object
| Constructor and Description |
|---|
MappingContext(MetaData metaData) |
| Modifier and Type | Method and Description |
|---|---|
Object |
addNodeEntity(Object entity)
Adds an entity to the MappingContext.
|
Object |
addNodeEntity(Object entity,
Long id)
Adds an entity to the MappingContext.
|
void |
addRelationship(MappedRelationship relationship) |
Object |
addRelationshipEntity(Object relationshipEntity,
Long id) |
void |
clear() |
boolean |
containsRelationship(MappedRelationship relationship) |
boolean |
detachNodeEntity(Long id) |
boolean |
detachRelationshipEntity(Long id) |
Object |
getNodeEntity(Long graphId)
Gets a node entity from the MappingContext by its graph id.
|
Object |
getNodeEntityById(ClassInfo classInfo,
Object id)
Get a node entity from the MappingContext by its primary id
|
Object |
getRelationshipEntity(Long relationshipId) |
Object |
getRelationshipEntityById(ClassInfo classInfo,
Object id)
Get a relationship entity from MappingContext by primary id
|
Set<MappedRelationship> |
getRelationships() |
Map<Long,Object> |
getSnapshotOfRelationshipEntityRegister() |
boolean |
isDirty(Object entity)
Check if the entity has been modified by comparing its current state to the state it had when registered.
|
Long |
nativeId(Object entity) |
Set<Object> |
neighbours(Object entity)
Get related objects of an entity / relationship.
|
void |
removeType(Class<?> type)
purges all information about objects of the supplied type
from the mapping context.
|
void |
replaceNodeEntity(Object entity,
Long identity) |
void |
replaceRelationshipEntity(Object entity,
Long id) |
void |
reset(Object entity)
purges all information about this object from the mapping context
and also sets its id to null.
|
public MappingContext(MetaData metaData)
public Object getNodeEntity(Long graphId)
getNodeEntityById(ClassInfo, Object) - you also need to check if such id
exists and is of correct typegraphId - The graph id to look for.public Object getNodeEntityById(ClassInfo classInfo, Object id)
classInfo - class info of the entity (this must be provided because id itself is not unique)id - primary id of the entitypublic Object addNodeEntity(Object entity)
entity - The object to add.public Object addNodeEntity(Object entity, Long id)
entity - The object to add.id - public boolean isDirty(Object entity)
entity - The entity to checkpublic boolean containsRelationship(MappedRelationship relationship)
public Set<MappedRelationship> getRelationships()
public void addRelationship(MappedRelationship relationship)
public void clear()
public Map<Long,Object> getSnapshotOfRelationshipEntityRegister()
public Object getRelationshipEntityById(ClassInfo classInfo, Object id)
classInfo - classInfo of the relationship entity (it is needed to because primary id may not be unique
across all relationship types)id - primary id of the entitypublic void removeType(Class<?> type)
type - the type whose object references and relationship mappings we want to purgepublic boolean detachNodeEntity(Long id)
public boolean detachRelationshipEntity(Long id)
public void reset(Object entity)
entity - the instance whose references and relationship mappings we want to resetpublic Set<Object> neighbours(Object entity)
entity - The entity to look neighbours for.Copyright © 2015–2020 Neo Technology, Inc.. All rights reserved.