ObjectDB ObjectDB

Internal Website Search

1-7 of 7 resultsRefresh

PostUpdate collection null

on MyEntity with a @PostUpdate method. When I try to access myCollection from the PostUpdate method ... ) {             this.id = id;         }                 @PostUpdate         public void postUpdate() {             System.out.println(myCollection.size());         }     } } The postUpdate method

PostUpdate on array changes

= "true"/> </entities> I'm not getting PostUpdate changes when a string is added to a list ... : PostUpdate events are fired if the list contains other Entities ! So, the question ... of A Then I expect a PostUpdate event to be fired for entity A, but no events are fired


javax.persistence Annotation PostUpdate Target: Callback methods Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class. Since: JPA 1.0 Learn how to define and use JPA

JPA Lifecycle Events

() {} @PostLoad void onPostLoad() {} @PreUpdate void onPreUpdate() {} @PostUpdate void ... - when an entity is identified as modified by the EntityManager. @PostUpdate - after updating an entity in ... ) {} @PostUpdate void onPostUpdate(Object o) {} @PreRemove void onPreRemove(Object o

JPA Annotations for Callback Methods

Reference (JavaDoc) of JPA 2 event callback and listener annotations, including @PrePersist(2), @PreRemove, @PreUpdate, @PostLoad, @PostPersist, @PostRemove and @PostUpdate.

@PrePersist Implementation

after the update use @PostUpdate. In order to be able to get told value in the @PreUpdate event

Entity listener - event instead of object

to compare on @PostUpdate the entity object after the update with the cloned detached entity object before the update. support Support

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support