org.springframework.data.neo4j.cross_store.support.node
Class CrossStoreNodeEntityInstantiator
java.lang.Object
org.springframework.data.neo4j.cross_store.support.node.CrossStoreNodeEntityInstantiator
- All Implemented Interfaces:
- EntityInstantiator<org.neo4j.graphdb.Node>
public class CrossStoreNodeEntityInstantiator
- extends Object
- implements EntityInstantiator<org.neo4j.graphdb.Node>
Entity instantiator for Node entities that takes into account that the entity is persisted in a JPA store as well.
- Since:
- 02.10.2010
- Author:
- Michael Hunger
Method Summary |
|
createEntityFromState(org.neo4j.graphdb.Node n,
Class<T> entityClass,
MappingPolicy mappingPolicy)
Takes the JPA id stored in the "FOREIGN_ID" property of the node for a EntityManager.find(Class, Object) operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CrossStoreNodeEntityInstantiator
public CrossStoreNodeEntityInstantiator(NodeEntityInstantiator delegate,
javax.persistence.EntityManagerFactory entityManagerFactory)
createEntityFromState
public <T> T createEntityFromState(org.neo4j.graphdb.Node n,
Class<T> entityClass,
MappingPolicy mappingPolicy)
- Takes the JPA id stored in the "FOREIGN_ID" property of the node for a
EntityManager.find(Class, Object)
operation.
If the entity is found its instance is associated with the graph node and returned otherwise a new node entity instance for
this node is created by the original EntityInstantiator
.
- Specified by:
createEntityFromState
in interface EntityInstantiator<org.neo4j.graphdb.Node>
- Type Parameters:
T
- generic type of the entity- Parameters:
n
- Node to instantiate an entity forentityClass
- type of the entitymappingPolicy
-
- Returns:
Copyright © 2011 SpringSource. All Rights Reserved.