Results 1 to 2 of 2

Thread: Spring Data JPA and Spring Data Neo4J Cross Store query question

  1. #1
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default Spring Data JPA and Spring Data Neo4J Cross Store query question

    This may sound stupid of me, but when working on an entity that is a cross store entity. You have to persist and quer y each database separately, Or can we do it with just one Repository or Template.

    So if I want to load a User object that is a cross store, can I just use the Neo4J GraphRepository find by id method and it will return a populated User object from data from both Neo4J and the relational database. And when I call the save method of GraphRepository that it will insert, update, delete from both databases correctly without any extra work on my part?

    I am guessing that yes, I find through GraphRepository that it gets from both database. Otherwise, why would the neo4j:config need a reference to the EntityManagerFactory bean

    Thanks

    Mark

  2. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Yes, if you load an entity via SDN you will get it fully populated. When saving though it is not yet saved to the JPA store, we might want to add that via the new BeforeSave Event.

    Same goes for deletion. Updates will work if they are done in a transaction b/c the commit of changes or loaded entities happens automatically.

    Can you raise an issue about this on spring.neo4j.org/issues ?

    Thanks

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •