I'm currently working on a project that makes use of Spring Data Neo4j. Whenever a NodeEntity is created, I would like to create a referenced Audit NodeEntity that contains the creation date and user.
A solution that I've come up with, is to write an AOP Aspect which hooks in on the create method of my service layer. This works fine for entities that aren't cascaded, but what about the cascaded ones? That are not explicitly passed in my service layer so my AOP class will not intercept them. Is there a concept like entity listeners in JPA, or how can I hook into this mechanism?