KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > listeners > FormsListener00


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: FormsListener00.java 591 2006-06-05 14:44:15Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.listeners;
26
27 import javax.persistence.PostLoad;
28 import javax.persistence.PostPersist;
29 import javax.persistence.PostRemove;
30 import javax.persistence.PostUpdate;
31 import javax.persistence.PrePersist;
32 import javax.persistence.PreRemove;
33 import javax.persistence.PreUpdate;
34
35 import org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType;
36 import org.objectweb.easybeans.tests.common.ejbs.entity.geometricforms.Form;
37
38 /**
39  * An entity listener.
40  * @author Gisele Pinheiro Souza
41  * @author Eduardo Studzinski Estima de Castro
42  *
43  */

44 public class FormsListener00{
45
46     /**
47      * Inserts in the database that the PrePersist method was called.
48      * @param f the form.
49      */

50     @PrePersist
51     public void prePersist(final Form f) {
52        FormsListenerBase.insertEntity(CallbackType.PRE_PERSIST, f, this.getClass().getName());
53     }
54
55     /**
56      * Inserts in the database that the PostPersist method was called.
57      * @param f the form.
58      */

59     @PostPersist
60     public void postPersist(final Form f) {
61         FormsListenerBase.insertEntity(CallbackType.POST_PERSIST, f, this.getClass().getName());
62     }
63
64     /**
65      * Inserts in the database that the PreRemove method was called.
66      * @param f the form.
67      */

68     @PreRemove
69     public void preRemove(final Form f) {
70         FormsListenerBase.insertEntity(CallbackType.PRE_REMOVE, f, this.getClass().getName());
71     }
72
73     /**
74      * Inserts in the database that the PostRemove method was called.
75      * @param f the form.
76      */

77     @PostRemove
78     public void postRemove(final Form f) {
79         FormsListenerBase.insertEntity(CallbackType.POST_REMOVE, f, this.getClass().getName());
80     }
81
82     /**
83      * Inserts in the database that the PreUpdate method was called.
84      * @param f the form.
85      */

86     @PreUpdate
87     public void preUpdate(final Form f) {
88         FormsListenerBase.insertEntity(CallbackType.PRE_UPDATE, f, this.getClass().getName());
89     }
90
91     /**
92      * Inserts in the database that the PostUpdate method was called.
93      * @param f the form.
94      */

95     @PostUpdate
96     public void postUpdate(final Form f) {
97         FormsListenerBase.insertEntity(CallbackType.POST_UPDATE, f, this.getClass().getName());
98     }
99
100     /**
101      * Inserts in the database that the PostLoad method was called.
102      * @param f the form.
103      */

104     @PostLoad
105     public void postLoad(final Form f) {
106         FormsListenerBase.insertEntity(CallbackType.POST_LOAD, f, this.getClass().getName());
107     }
108 }
109
Popular Tags