KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > readahead > ejb > CMPFindTestEntity


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.readahead.ejb;
23
24 import javax.ejb.EntityBean JavaDoc;
25 import javax.ejb.CreateException JavaDoc;
26 import javax.ejb.RemoveException JavaDoc;
27 import javax.ejb.EntityContext JavaDoc;
28
29 /**
30  * Implementation class for one of the entities used in read-ahead finder
31  * tests
32  *
33  * @author <a HREF="mailto:danch@nvisia.com">danch (Dan Christopherson</a>
34  * @version $Id: CMPFindTestEntity.java 58115 2006-11-04 08:42:14Z scott.stark@jboss.org $
35  *
36  * Revision:
37  */

38 public class CMPFindTestEntity implements EntityBean JavaDoc {
39    org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(getClass());
40    
41    EntityContext JavaDoc entityContext;
42    public String JavaDoc key;
43    public String JavaDoc name;
44    public String JavaDoc rank;
45    public String JavaDoc serialNumber;
46    private boolean modified;
47    
48    public String JavaDoc ejbCreate(String JavaDoc key) throws CreateException JavaDoc {
49       this.key = key;
50       return key;
51    }
52    public boolean isModified() {
53       return modified;
54    }
55    public void ejbPostCreate(String JavaDoc key) throws CreateException JavaDoc {
56    }
57    public void ejbRemove() throws RemoveException JavaDoc {
58    }
59    public void ejbActivate() {
60    }
61    public void ejbPassivate() {
62    }
63    public void ejbLoad() {
64       modified = false;
65    }
66    public void ejbStore() {
67       modified = false;
68    }
69    public void setEntityContext(EntityContext JavaDoc entityContext) {
70       this.entityContext = entityContext;
71    }
72    public void unsetEntityContext() {
73       entityContext = null;
74    }
75    public String JavaDoc getKey() {
76       return key;
77    }
78    public void setName(String JavaDoc newName) {
79       name = newName;
80    }
81    public String JavaDoc getName() {
82       return name;
83    }
84    public void setRank(String JavaDoc newRank) {
85       rank = newRank;
86       modified = true;
87    }
88    public String JavaDoc getRank() {
89       return rank;
90    }
91    public void setSerialNumber(String JavaDoc newSerialNumber) {
92       serialNumber = newSerialNumber;
93       modified = true;
94    }
95    public String JavaDoc getSerialNumber() {
96       return serialNumber;
97    }
98 }
99
Popular Tags