View Javadoc

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;
23  import javax.ejb.EntityBean;
24  import javax.ejb.EntityContext;
25  import javax.ejb.RemoveException;
26  
27  /**
28   * 
29   * 
30   * @version $Rev: 439078 $ $Date: 2006-08-31 15:46:14 -0700 (Thu, 31 Aug 2006) $
31   */
32  public class SimpleBMPEntityEJB implements EntityBean {
33      private static final Integer PK = new Integer(1);
34      private static String name = "SomeName";
35      private static String value = "SomeValue";
36  
37      public Integer ejbCreate() {
38          return PK;
39      }
40  
41      public void ejbPostCreate() {
42      }
43  
44      public Integer ejbFindByPrimaryKey(Integer key) throws javax.ejb.FinderException {
45          if(PK.equals(key)) {
46              return PK;
47          } else {
48              return null;
49          }
50      }
51  
52      public String getName() {
53          return name;
54      }
55  
56      public void setName(String name) {
57          SimpleBMPEntityEJB.name = name;
58      }
59  
60      public String getValue() {
61          return value;
62      }
63  
64      public void setValue(String value) {
65          SimpleBMPEntityEJB.value = value;
66      }
67  
68      public void ejbActivate() throws EJBException {
69      }
70  
71      public void ejbLoad() throws EJBException {
72      }
73  
74      public void ejbPassivate() throws EJBException {
75      }
76  
77      public void ejbRemove() throws RemoveException, EJBException {
78      }
79  
80      public void ejbStore() throws EJBException {
81      }
82  
83      public void setEntityContext(EntityContext ctx) throws EJBException {
84      }
85  
86      public void unsetEntityContext() throws EJBException {
87      }
88  }