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 Scalene extends Triangle { 49 50 53 public static final String WRONG_CALL = "WRONG"; 54 55 58 private int dummyField; 59 60 64 public int getDummyField() { 65 return dummyField; 66 } 67 68 72 public void setDummyField(final int dummyField) { 73 this.dummyField = dummyField; 74 } 75 76 80 @Override 81 public void prePersist() { 82 FormsListenerBase.insertEntity(CallbackType.PRE_PERSIST, this, this.getClass().getName() + WRONG_CALL); 83 } 84 85 89 @Override 90 public void postPersist() { 91 FormsListenerBase.insertEntity(CallbackType.POST_PERSIST, this, this.getClass().getName() + WRONG_CALL); 92 } 93 94 98 @Override 99 public void preRemove() { 100 FormsListenerBase.insertEntity(CallbackType.PRE_REMOVE, this, this.getClass().getName() + WRONG_CALL); 101 } 102 103 107 @Override 108 public void postRemove() { 109 FormsListenerBase.insertEntity(CallbackType.POST_REMOVE, this, this.getClass().getName() + WRONG_CALL); 110 } 111 112 116 @Override 117 public void preUpdate() { 118 FormsListenerBase.insertEntity(CallbackType.PRE_UPDATE, this, this.getClass().getName() + WRONG_CALL); 119 } 120 121 125 @Override 126 public void postLoad() { 127 FormsListenerBase.insertEntity(CallbackType.POST_LOAD, this, this.getClass().getName() + WRONG_CALL); 128 } 129 130 134 @Override 135 public void postUpdate() { 136 FormsListenerBase.insertEntity(CallbackType.POST_UPDATE, this, this.getClass().getName() + WRONG_CALL); 137 } 138 139 143 @PrePersist 144 public void prePersist1() { 145 FormsListenerBase.insertEntity(CallbackType.PRE_PERSIST, this, this.getClass().getName()); 146 } 147 148 152 @PostPersist 153 public void postPersist1() { 154 FormsListenerBase.insertEntity(CallbackType.POST_PERSIST, this, this.getClass().getName()); 155 } 156 157 161 @PreRemove 162 public void preRemove1() { 163 FormsListenerBase.insertEntity(CallbackType.PRE_REMOVE, this, this.getClass().getName()); 164 } 165 166 170 @PostRemove 171 public void postRemove1() { 172 FormsListenerBase.insertEntity(CallbackType.POST_REMOVE, this, this.getClass().getName()); 173 } 174 175 179 @PreUpdate 180 public void preUpdate1() { 181 FormsListenerBase.insertEntity(CallbackType.PRE_UPDATE, this, this.getClass().getName()); 182 } 183 184 188 @PostLoad 189 public void postLoad1() { 190 FormsListenerBase.insertEntity(CallbackType.POST_LOAD, this, this.getClass().getName()); 191 } 192 193 197 @PostUpdate 198 public void postUpdate1() { 199 FormsListenerBase.insertEntity(CallbackType.POST_UPDATE, this, this.getClass().getName()); 200 } 201 } 202 | Popular Tags |