KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > ebasic > E4QueryEC2


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@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: E4QueryEC2.java,v 1.4 2004/07/06 10:04:09 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jtests.beans.ebasic;
27
28 import javax.ejb.CreateException JavaDoc;
29 import javax.ejb.EntityBean JavaDoc;
30 import javax.ejb.EntityContext JavaDoc;
31 import javax.ejb.RemoveException JavaDoc;
32
33 import org.objectweb.jonas.common.Log;
34 import org.objectweb.util.monolog.api.BasicLevel;
35 import org.objectweb.util.monolog.api.Logger;
36
37
38 /**
39  * This is an entity bean with "container managed persistence version 2.x".
40  * The state of an instance is stored into a relational database.
41  * @author Helene Joanin
42  */

43
44 public abstract class E4QueryEC2 implements EntityBean JavaDoc {
45
46     static protected Logger logger = null;
47
48     protected EntityContext JavaDoc entityContext;
49
50
51     // Get and Set accessor methods of the bean's abstract schema
52
public abstract String JavaDoc getId();
53     public abstract void setId(String JavaDoc s);
54     public abstract String JavaDoc getFstring();
55     public abstract void setFstring(String JavaDoc s);
56     public abstract int getFint();
57     public abstract void setFint(int i);
58     public abstract double getFdouble();
59     public abstract void setFdouble(double i);
60
61     public void ejbActivate() {
62         logger.log(BasicLevel.DEBUG, "");
63     }
64
65     public void ejbPassivate() {
66         logger.log(BasicLevel.DEBUG, "");
67     }
68
69     public void ejbLoad() {
70         logger.log(BasicLevel.DEBUG, "");
71     }
72
73     public void ejbStore() {
74         logger.log(BasicLevel.DEBUG, "");
75     }
76   
77     public void ejbRemove() throws RemoveException JavaDoc {
78         logger.log(BasicLevel.DEBUG, "");
79     }
80
81     public void setEntityContext(EntityContext JavaDoc ctx) {
82         if (logger == null)
83             logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
84         logger.log(BasicLevel.DEBUG, "");
85         entityContext = ctx;
86     
87     }
88
89     public void unsetEntityContext() {
90         logger.log(BasicLevel.DEBUG, "");
91     }
92
93     public String JavaDoc ejbCreate(String JavaDoc id, String JavaDoc s, int i, double d) throws CreateException JavaDoc {
94         logger.log(BasicLevel.DEBUG, "create "+id+","+s+","+i+","+d);
95         setId(id);
96         setFstring(s);
97         setFint(i);
98         setFdouble(d);
99         return(null);
100     }
101
102     public void ejbPostCreate(String JavaDoc id, String JavaDoc s, int i, double d){
103         logger.log(BasicLevel.DEBUG, "");
104     }
105
106 }
107
Popular Tags