KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > entity > geometricforms > Trapezoid


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: Trapezoid.java 1102 2006-08-16 13:07:26Z benoitf $
23  * --------------------------------------------------------------------------
24  */

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 /**
41  * Represents the trapezoid. Defines the callback methods in the class.
42  * @author Gisele Pinheiro Souza
43  * @author Eduardo Studzinski Estima de Castro
44  *
45  */

46 @Entity
47 @TableGenerator(name = "ID_SEQ", allocationSize = 1)
48 public class Trapezoid extends Form {
49
50     /**
51      * A trapezoid side.
52      */

53     private float side1;
54
55     /**
56      * A trapezoid side.
57      */

58     private float side2;
59
60     /**
61      * Gets a trapezoid side.
62      * @return the side.
63      */

64     public float getSide1() {
65         return side1;
66     }
67
68     /**
69      * Sets a trapezoid side.
70      * @param side1 the side.
71      */

72     public void setSide1(final float side1) {
73         this.side1 = side1;
74     }
75
76     /**
77      * Gets a trapezoid side.
78      * @return the side.
79      */

80     public float getSide2() {
81         return side2;
82     }
83
84     /**
85      * Sets the trapezoid side.
86      * @param side2 the side.
87      */

88     public void setSide2(final float side2) {
89         this.side2 = side2;
90     }
91
92     /**
93      * Inserts in the lifecycle callback logger that the PrePersist callback
94      * method was called.
95      */

96     @PrePersist
97     public void prePersist() {
98         FormsListenerBase.insertEntity(CallbackType.PRE_PERSIST, this, this.getClass().getName());
99     }
100
101     /**
102      * Inserts in the lifecycle callback logger that the PostPersist callback
103      * method was called.
104      */

105     @PostPersist
106     public void postPersist() {
107         FormsListenerBase.insertEntity(CallbackType.POST_PERSIST, this, this.getClass().getName());
108     }
109
110     /**
111      * Inserts in the lifecycle callback logger that the PreRemove callback
112      * method was called.
113      */

114     @PreRemove
115     public void preRemove() {
116         FormsListenerBase.insertEntity(CallbackType.PRE_REMOVE, this, this.getClass().getName());
117     }
118
119     /**
120      * Inserts in the lifecycle callback logger that the PostRemove callback
121      * method was called.
122      */

123     @PostRemove
124     public void postRemove() {
125         FormsListenerBase.insertEntity(CallbackType.POST_REMOVE, this, this.getClass().getName());
126     }
127
128     /**
129      * Inserts in the lifecycle callback logger that the PreUpdate callback
130      * method was called.
131      */

132     @PreUpdate
133     public void preUpdate() {
134         FormsListenerBase.insertEntity(CallbackType.PRE_UPDATE, this, this.getClass().getName());
135     }
136
137     /**
138      * Inserts in the lifecycle callback logger that the PostLoad callback
139      * method was called.
140      */

141     @PostLoad
142     public void postLoad() {
143         FormsListenerBase.insertEntity(CallbackType.POST_LOAD, this, this.getClass().getName());
144     }
145
146     /**
147      * Inserts in the lifecycle callback logger that the PostUpdate callback
148      * method was called.
149      */

150     @PostUpdate
151     public void postUpdate() {
152         FormsListenerBase.insertEntity(CallbackType.POST_UPDATE, this, this.getClass().getName());
153     }
154
155 }
156
Popular Tags