public Node createProxyNode ( Object sourceNodeId , Object targetNodeId , GraphDatabaseService graphDb , EntityMetadata sourceEntityMetadata , EntityMetadata targetEntityMetadata ) { String sourceNodeIdColumnName = ( ( AbstractAttribute ) sourceEntityMetadata . getIdAttribute ( ) ) . getJPAColumnName ( ) ; String targetNodeIdColumnName = ( ( AbstractAttribute ) targetEntityMetadata . getIdAttribute ( ) ) . getJPAColumnName ( ) ; Node node = graphDb . createNode ( ) ; node . setProperty ( PROXY_NODE_TYPE_KEY , PROXY_NODE_VALUE ) ; node . setProperty ( sourceNodeIdColumnName , sourceNodeId ) ; node . setProperty ( targetNodeIdColumnName , targetNodeId ) ; return node ; }
Create Proxy nodes into Neo4J . Proxy nodes are defined as nodes in Neo4J that refer to a record in some other database . They cater to polyglot persistence cases .