001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: E4QueryEC2.java 5071 2004-07-06 10:04:09Z durieuxp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.beans.ebasic;
027:
028: import javax.ejb.CreateException;
029: import javax.ejb.EntityBean;
030: import javax.ejb.EntityContext;
031: import javax.ejb.RemoveException;
032:
033: import org.objectweb.jonas.common.Log;
034: import org.objectweb.util.monolog.api.BasicLevel;
035: import org.objectweb.util.monolog.api.Logger;
036:
037: /**
038: * This is an entity bean with "container managed persistence version 2.x".
039: * The state of an instance is stored into a relational database.
040: * @author Helene Joanin
041: */
042:
043: public abstract class E4QueryEC2 implements EntityBean {
044:
045: static protected Logger logger = null;
046:
047: protected EntityContext entityContext;
048:
049: // Get and Set accessor methods of the bean's abstract schema
050: public abstract String getId();
051:
052: public abstract void setId(String s);
053:
054: public abstract String getFstring();
055:
056: public abstract void setFstring(String s);
057:
058: public abstract int getFint();
059:
060: public abstract void setFint(int i);
061:
062: public abstract double getFdouble();
063:
064: public abstract void setFdouble(double i);
065:
066: public void ejbActivate() {
067: logger.log(BasicLevel.DEBUG, "");
068: }
069:
070: public void ejbPassivate() {
071: logger.log(BasicLevel.DEBUG, "");
072: }
073:
074: public void ejbLoad() {
075: logger.log(BasicLevel.DEBUG, "");
076: }
077:
078: public void ejbStore() {
079: logger.log(BasicLevel.DEBUG, "");
080: }
081:
082: public void ejbRemove() throws RemoveException {
083: logger.log(BasicLevel.DEBUG, "");
084: }
085:
086: public void setEntityContext(EntityContext ctx) {
087: if (logger == null)
088: logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
089: logger.log(BasicLevel.DEBUG, "");
090: entityContext = ctx;
091:
092: }
093:
094: public void unsetEntityContext() {
095: logger.log(BasicLevel.DEBUG, "");
096: }
097:
098: public String ejbCreate(String id, String s, int i, double d)
099: throws CreateException {
100: logger.log(BasicLevel.DEBUG, "create " + id + "," + s + "," + i
101: + "," + d);
102: setId(id);
103: setFstring(s);
104: setFint(i);
105: setFdouble(d);
106: return (null);
107: }
108:
109: public void ejbPostCreate(String id, String s, int i, double d) {
110: logger.log(BasicLevel.DEBUG, "");
111: }
112:
113: }
|