1 22 package org.jboss.ejb3.test.entitycallback; 23 24 import javax.persistence.PrePersist; 25 import javax.persistence.PostPersist; 26 import javax.persistence.PreRemove; 27 import javax.persistence.PostRemove; 28 import javax.persistence.PreUpdate; 29 import javax.persistence.PostUpdate; 30 import javax.persistence.PostLoad; 31 32 36 public class JourneyCallbackListener 37 { 38 @PrePersist 39 public void doPreCreate(Object bean) 40 { 41 System.out.println("Journey doPreCreate"); 42 CallbackCounterBean.addCallback("Journey", PrePersist.class); 43 } 44 45 @PostPersist 46 public void doPostCreate(Object bean) 47 { 48 System.out.println("Journey doPostCreate"); 49 CallbackCounterBean.addCallback("Journey", PostPersist.class); 50 } 51 52 @PreRemove 53 public void doPreRemove(Object bean) 54 { 55 System.out.println("Journey doPreRemove"); 56 CallbackCounterBean.addCallback("Journey", PreRemove.class); 57 } 58 59 @PostRemove 60 public void doPostRemove(Object bean) 61 { 62 System.out.println("Journey doPostRemove"); 63 CallbackCounterBean.addCallback("Journey", PostRemove.class); 64 } 65 66 @PreUpdate 67 public void doPreUpdate(Object bean) 68 { 69 System.out.println("Journey doPreUpdate"); 70 CallbackCounterBean.addCallback("Journey", PreUpdate.class); 71 } 72 73 @PostUpdate 74 public void doPostUpdate(Object bean) 75 { 76 System.out.println("Journey doPostUpdate"); 77 CallbackCounterBean.addCallback("Journey", PostUpdate.class); 78 } 79 80 @PostLoad 81 public void doPostLoad(Object bean) 82 { 83 System.out.println("Journey doPostLoad"); 84 CallbackCounterBean.addCallback("Journey", PostLoad.class); 85 } 86 87 } 88 | Popular Tags |