I am trying to get a very minimal JPA + SDN (Spring Data Neo4j) cross store project running and am trying to demonstrate that saving a partial entity using a JPA repository call will create a corresponding node in Neo4j.
I have followed the instructions / advice that I have been able to find on SO, Google and Spring's site but am currently still having trouble standing things up. I currently have a minimal test project created at:
https://github.com/simon-lam/sdn-cross-store-poc
The project uses Spring Boot and has a simple domain containing a graph entity, GraphNodeEntity.java
, and a partial entity, PartialEntity.java
. I have written a very basic test, PartialEntityRepositoryTest.java
, to do a save on the partial entity and am seeing:
- The wrong transaction manager seems to be used because the
CrossStoreNeo4jConfiguration
class does not properly autowireentityManagerFactory
, it is null - As a result of the above ^, no ID is assigned to my entity
- I do not see any SDN activity in the logs at all
- Am I doing something glaringly wrong?
More generally, I was hoping to confirm some assumptions and better understand cross store persistence support in general:
- To enable it, do I need to enable advanced mapping?
- As part of enabling advanced mapping, I need to set up AspectJ; does this include enabling load time weaving? If so is this accomplished through using the
@EnableLoadTimeWeaving
config? - Assuming that all my configuration is eventually fixed, should I expect to see partial nodes persist in Neo4j when I persist them using a JPA repository? This should be handled by the cross store support which is driven by aspects right?
Thank you for any help that can be offered!
I sent a message to the Neo4j Google Group and got some feedback from Michael Hunger so I'm going to share here:
So in summary my core understanding / assumptions were off!
Source: https://groups.google.com/forum/#!topic/neo4j/FGI8692AVJQ