001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.readahead.ejb;
023:
024: import javax.ejb.EntityBean;
025: import javax.ejb.CreateException;
026: import javax.ejb.RemoveException;
027: import javax.ejb.EntityContext;
028:
029: /**
030: * Implementation class for one of the entities used in read-ahead finder
031: * tests
032: *
033: * @author <a href="mailto:danch@nvisia.com">danch (Dan Christopherson</a>
034: * @version $Id: CMPFindTestEntity.java 57211 2006-09-26 12:39:46Z dimitris@jboss.org $
035: *
036: * Revision:
037: */
038: public class CMPFindTestEntity implements EntityBean {
039: org.apache.log4j.Category log = org.apache.log4j.Category
040: .getInstance(getClass());
041:
042: EntityContext entityContext;
043: public String key;
044: public String name;
045: public String rank;
046: public String serialNumber;
047: private boolean modified;
048:
049: public String ejbCreate(String key) throws CreateException {
050: this .key = key;
051: return key;
052: }
053:
054: public boolean isModified() {
055: return modified;
056: }
057:
058: public void ejbPostCreate(String key) throws CreateException {
059: }
060:
061: public void ejbRemove() throws RemoveException {
062: }
063:
064: public void ejbActivate() {
065: }
066:
067: public void ejbPassivate() {
068: }
069:
070: public void ejbLoad() {
071: modified = false;
072: }
073:
074: public void ejbStore() {
075: modified = false;
076: }
077:
078: public void setEntityContext(EntityContext entityContext) {
079: this .entityContext = entityContext;
080: }
081:
082: public void unsetEntityContext() {
083: entityContext = null;
084: }
085:
086: public String getKey() {
087: return key;
088: }
089:
090: public void setName(String newName) {
091: name = newName;
092: }
093:
094: public String getName() {
095: return name;
096: }
097:
098: public void setRank(String newRank) {
099: rank = newRank;
100: modified = true;
101: }
102:
103: public String getRank() {
104: return rank;
105: }
106:
107: public void setSerialNumber(String newSerialNumber) {
108: serialNumber = newSerialNumber;
109: modified = true;
110: }
111:
112: public String getSerialNumber() {
113: return serialNumber;
114: }
115: }
|