How do I properly set up cross-store persistence u

2019-02-26 04:19发布

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 autowire entityManagerFactory, 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!

1条回答
Fickle 薄情
2楼-- · 2019-02-26 05:04

I sent a message to the Neo4j Google Group and got some feedback from Michael Hunger so I'm going to share here:

  • Turns out the cross store lib has been dormant for a while
  • JPA repos are not supported, only the EntityManager operations are
  • The cross store setup was not meant for a remote server and was not tested

So in summary my core understanding / assumptions were off!

Source: https://groups.google.com/forum/#!topic/neo4j/FGI8692AVJQ

查看更多
登录 后发表回答