0

Have a trouble with nested entities while calling Neo4jTemplate.save(...).

Actually yes, nested entities being persisted as well, but BeforeSaveEvent only invoked on parent entity.

In BeforeSaveEvent, I populate uuid and timeCreated fields for all entities.

I don't want to create this value by myself in class constructor.

So, I'm considering the following solutions:

  • make it somehow work as I expected (a tough one).

  • do not even try persist nested entities and persist all entities in a separate way...

  • create uuid and timeCreated in class constructor

  • use external library (most unlikely)

Any advice?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
maret
  • 1,826
  • 1
  • 13
  • 18
  • I've edited your question to [format code elements](http://stackoverflow.com/help/formatting) as code. I fixed a typo (possibly) by changing the second `uui` to `uuid` to match the first `uuid`. – Wai Ha Lee Dec 07 '15 at 17:17
  • Thanks! Forgot to format 'code' lines – maret Dec 07 '15 at 18:30

1 Answers1

0

This is a known issue: https://jira.spring.io/browse/DATAGRAPH-710 but hasn't been assigned to a specific release yet.

In the meanwhile, perhaps you can use an unmanaged extension that makes use of a transaction event handler to do the job. If you go this route, the GraphAware TxDrivenModules will help.

Luanne
  • 19,145
  • 1
  • 39
  • 51