Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Spring Data Neo4j - Handling simple objects as NodeEntity properties

  1. #11
    Join Date
    Aug 2008
    Posts
    9

    Default

    Michael, quick question ...

    Where do you suggest I keep the Neo4jTemplate object. I cannot pass it in the object constructor to a transient private variable since we need a no-arg constructor, and passing it to a getter kind of leaks the db abstraction through my API. Any suggestion ?

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

    Default

    You probably don't need it inside of your methods, the simple save() operation cascades at least to relationship-objects.

    Could you handle this as part of a service? So you can persist the actual relationship-entities before they are added to the collection which might be good enough, depending on your use-case.

    Michael

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

    Default

    Quote Originally Posted by MichaelHunger View Post
    Do you have a test-case for that?

    It should do it.

    Michael
    Sorry, no test case.

    After I saw that I wasn't retrieved the related nodes with fetch, I went down a separate path where I first get the top level Node then on the client side page I use AJAX to $.get() each collection as JSON and update the page when the JSON comes back. this way I can have 7 different .gets happening simultaneously to get all the collection nodes. And even yesterday I decided to restructure my page, so now I get a list of wrapper objects. no nodes for even less data being transferred. I will just write a nice complex traversal query to get just what I need on the first .get request. (Except for the index.jsp with no data, all my requests are REST Ajax JSON from client to server)

    Thanks

    Mark

Posting Permissions

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