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 Trapezoid extends Form { 49 50 53 private float side1; 54 55 58 private float side2; 59 60 64 public float getSide1() { 65 return side1; 66 } 67 68 72 public void setSide1(final float side1) { 73 this.side1 = side1; 74 } 75 76 80 public float getSide2() { 81 return side2; 82 } 83 84 88 public void setSide2(final float side2) { 89 this.side2 = side2; 90 } 91 92 96 @PrePersist 97 public void prePersist() { 98 FormsListenerBase.insertEntity(CallbackType.PRE_PERSIST, this, this.getClass().getName()); 99 } 100 101 105 @PostPersist 106 public void postPersist() { 107 FormsListenerBase.insertEntity(CallbackType.POST_PERSIST, this, this.getClass().getName()); 108 } 109 110 114 @PreRemove 115 public void preRemove() { 116 FormsListenerBase.insertEntity(CallbackType.PRE_REMOVE, this, this.getClass().getName()); 117 } 118 119 123 @PostRemove 124 public void postRemove() { 125 FormsListenerBase.insertEntity(CallbackType.POST_REMOVE, this, this.getClass().getName()); 126 } 127 128 132 @PreUpdate 133 public void preUpdate() { 134 FormsListenerBase.insertEntity(CallbackType.PRE_UPDATE, this, this.getClass().getName()); 135 } 136 137 141 @PostLoad 142 public void postLoad() { 143 FormsListenerBase.insertEntity(CallbackType.POST_LOAD, this, this.getClass().getName()); 144 } 145 146 150 @PostUpdate 151 public void postUpdate() { 152 FormsListenerBase.insertEntity(CallbackType.POST_UPDATE, this, this.getClass().getName()); 153 } 154 155 } 156 | Popular Tags |