use of org.neo4j.ogm.transaction.AbstractTransaction in project neo4j-ogm by neo4j.
the class RequestExecutor method initialiseNewEntity.
/**
* Register entities in the {@link MappingContext}
*
* @param persisted entity created as part of the request
*/
private void initialiseNewEntity(Long identity, Object persisted) {
MappingContext mappingContext = session.context();
Transaction tx = session.getTransaction();
if (persisted != null) {
// it will be null if the variable represents a simple relationship.
// set the id field of the newly created domain object
EntityUtils.setIdentity(persisted, identity, session.metaData());
ClassInfo classInfo = session.metaData().classInfo(persisted);
if (tx != null) {
((AbstractTransaction) tx).registerNew(persisted);
}
registerEntity(mappingContext, classInfo, identity, persisted);
}
}
Aggregations