About Question enthuware.oce-jpad.v6.2.421 :
Posted: Sun Jul 23, 2017 11:07 am
@Entity public class LifecycleCallbackTestEntity implements Serializable {
// attributes and accessor methods not shown
@PostPersist public void m1(){
System.out.println("X");
}
@PostUpdate public void m2(){
System.out.println("Y");
}
}
What will be printed when an application performs the following steps -
1. Begins a transaction 2. Creates the entity 3. Persists the entity 4. Updates the entity 5. Updates the entity again 6. Commits the transaction
Please help me out with the proper reason
// attributes and accessor methods not shown
@PostPersist public void m1(){
System.out.println("X");
}
@PostUpdate public void m2(){
System.out.println("Y");
}
}
What will be printed when an application performs the following steps -
1. Begins a transaction 2. Creates the entity 3. Persists the entity 4. Updates the entity 5. Updates the entity again 6. Commits the transaction
Please help me out with the proper reason