Entity lifecycle callback methods may be defined in which three classes? (Choose three)
A.
Embedded classes
B.
Entity classes
C.
Abstract classes
D.
Entity listener classes
E.
Mapped superclasses
F.
Concrete non-entity superclasses
Explanation:
http://stackoverflow.com/questions/3747268/how-to-inject-a-springs-service-bean-into-a-jpa-entity(See the answer, first paragraph)
Correct answer, please follow the following link, and check all the callback methods
http://www.objectdb.com/api/java/jpa/annotations/callback
Correct answer
A lifecycle callback method may be defined on an entity class, a mapped superclass, or an entity listener class associated with an entity or mapped superclass
some rules for callback methods :
1.Callback methods defined on an entity listener class have the following signature:
void (Object)
The callback methods can have public, private, protected, or package level access, but must not be static or final.
2. At the most one method for one lifecycle event can exist in a class.
The following rules apply to lifecycle callbacks:
1. Lifecycle callback methods may throw unchecked/runtime exceptions. A runtime exception thrown by a callback method that executes within a transaction causes that transaction to be marked for rollback.
2. Lifecycle callbacks can invoke JNDI, JDBC, JMS, and enterprise beans.
3. In general, the lifecycle method of a portable application should not invoke EntityManager or Query operations, access other entity instances, or modify relationships within the same persistence context. A lifecycle callback method may modify the non-relationship state of the entity on which it is invoked.
BCD
Sorry, the answer is correct.
nfl shop outlet nhl shop cyber monday discount code black friday nhl shop coupon code
JPA 2.0 specification:
3.5.1 Lifecycle Callback Methods
Entity lifecycle callback methods can be defined on an entity listener class and/or directly on an entity class or mapped superclass.