KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > test > simple > bmp > SimpleBMPEntityEJB


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */

19
20 package org.openejb.test.simple.bmp;
21
22 import javax.ejb.EJBException JavaDoc;
23 import javax.ejb.EntityBean JavaDoc;
24 import javax.ejb.EntityContext JavaDoc;
25 import javax.ejb.RemoveException JavaDoc;
26
27 /**
28  *
29  *
30  * @version $Rev: 476321 $ $Date: 2006-11-17 16:18:49 -0500 (Fri, 17 Nov 2006) $
31  */

32 public class SimpleBMPEntityEJB implements EntityBean JavaDoc {
33     private static final Integer JavaDoc PK = new Integer JavaDoc(1);
34     private static String JavaDoc name = "SomeName";
35     private static String JavaDoc value = "SomeValue";
36
37     public Integer JavaDoc ejbCreate() {
38         return PK;
39     }
40
41     public void ejbPostCreate() {
42     }
43
44     public Integer JavaDoc ejbFindByPrimaryKey(Integer JavaDoc key) throws javax.ejb.FinderException JavaDoc {
45         if(PK.equals(key)) {
46             return PK;
47         } else {
48             return null;
49         }
50     }
51
52     public String JavaDoc getName() {
53         return name;
54     }
55
56     public void setName(String JavaDoc name) {
57         SimpleBMPEntityEJB.name = name;
58     }
59
60     public String JavaDoc getValue() {
61         return value;
62     }
63
64     public void setValue(String JavaDoc value) {
65         SimpleBMPEntityEJB.value = value;
66     }
67
68     public void ejbActivate() throws EJBException JavaDoc {
69     }
70
71     public void ejbLoad() throws EJBException JavaDoc {
72     }
73
74     public void ejbPassivate() throws EJBException JavaDoc {
75     }
76
77     public void ejbRemove() throws RemoveException JavaDoc, EJBException JavaDoc {
78     }
79
80     public void ejbStore() throws EJBException JavaDoc {
81     }
82
83     public void setEntityContext(EntityContext JavaDoc ctx) throws EJBException JavaDoc {
84     }
85
86     public void unsetEntityContext() throws EJBException JavaDoc {
87     }
88 }
89
Popular Tags