1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.geometricforms; 26 27 import javax.persistence.Entity; 28 import javax.persistence.PostLoad; 29 import javax.persistence.PostPersist; 30 import javax.persistence.PostRemove; 31 import javax.persistence.PostUpdate; 32 import javax.persistence.PrePersist; 33 import javax.persistence.PreRemove; 34 import javax.persistence.PreUpdate; 35 import javax.persistence.TableGenerator; 36 37 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType; 38 import org.objectweb.easybeans.tests.common.listeners.FormsListenerBase; 39 40 46 @Entity 47 @TableGenerator(name = "ID_SEQ", allocationSize = 1) 48 public class Isosceles extends Triangle { 49 50 53 private int dummyField; 54 55 59 public int getDummyField() { 60 return dummyField; 61 } 62 63 67 public void setDummyField(final int dummyField) { 68 this.dummyField = dummyField; 69 } 70 71 75 @PostPersist 76 @Override 77 public void prePersist() { 78 FormsListenerBase.insertEntity(CallbackType.POST_PERSIST, this, this.getClass().getName()); 79 } 80 81 85 @Override 86 @PrePersist 87 public void postPersist() { 88 FormsListenerBase.insertEntity(CallbackType.PRE_PERSIST, this, this.getClass().getName()); 89 } 90 91 95 @PostRemove 96 @Override 97 public void preRemove() { 98 FormsListenerBase.insertEntity(CallbackType.POST_REMOVE, this, this.getClass().getName()); 99 } 100 101 105 @PreRemove 106 @Override 107 public void postRemove() { 108 FormsListenerBase.insertEntity(CallbackType.PRE_REMOVE, this, this.getClass().getName()); 109 } 110 111 115 @PostUpdate 116 @Override 117 public void preUpdate() { 118 FormsListenerBase.insertEntity(CallbackType.POST_UPDATE, this, this.getClass().getName()); 119 } 120 121 125 @PreUpdate 126 @Override 127 public void postLoad() { 128 FormsListenerBase.insertEntity(CallbackType.PRE_UPDATE, this, this.getClass().getName()); 129 } 130 131 135 @PostLoad 136 @Override 137 public void postUpdate() { 138 FormsListenerBase.insertEntity(CallbackType.POST_LOAD, this, this.getClass().getName()); 139 } 140 } 141 | Popular Tags |