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 Triangle extends Form { 49 50 53 private float height; 54 55 58 private float base; 59 60 64 public float getBase() { 65 return base; 66 } 67 68 72 public void setBase(final float base) { 73 this.base = base; 74 } 75 76 80 public float getHeight() { 81 return height; 82 } 83 84 88 public void setHeight(final float height) { 89 this.height = height; 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.POST_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 | Popular Tags |