KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > ejb > BasePropertyEntityBean


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13
14 package org.ejbca.core.ejb;
15
16 import javax.ejb.CreateException JavaDoc;
17
18
19
20 /**
21  * Base class for property entity beans implementing required methods and helpers.
22  * A property entity bean extends other entity beans with propertys.
23  *
24  * Primary Key is a combined id and property hash.
25  * id (String) primary key of entity bean using this property entity bean.
26  * property String should be one of the property constants.
27  * value (String) the value of the property.
28  *
29  * @version $Id: BasePropertyEntityBean.java,v 1.1 2006/01/17 20:30:04 anatom Exp $
30  *
31  * @ejb.bean
32  * generate="false"
33  * name="BaseProperty"
34  * display-name="BasePropertyEB"
35  * view-type="local"
36  * cmp-version="2.x"
37  *
38  * @ejb.pk
39  * class="org.ejbca.core.ejb.PropertyEntityPK"
40  * extends="java.lang.Object"
41  *
42  * @ejb.home
43  * generate="local"
44  * local-extends="javax.ejb.EJBLocalHome"
45  * local-class="org.ejbca.core.ejb.BasePropertyDataLocalHome"
46  *
47  * @ejb.interface
48  * generate="local"
49  * local-extends="javax.ejb.EJBLocalObject"
50  * local-class="org.ejbca.core.ejb.BasePropertyDataLocal"
51  */

52 public abstract class BasePropertyEntityBean extends BaseEntityBean {
53
54     /**
55      * @ejb.persistence
56      * @ejb.pk-field
57      * @ejb.interface-method
58      */

59     public abstract String JavaDoc getId();
60
61     /**
62      * @ejb.persistence
63      */

64     public abstract void setId(String JavaDoc id);
65
66     /**
67      * @ejb.persistence
68      * @ejb.pk-field
69      * @ejb.interface-method
70      */

71     public abstract String JavaDoc getProperty();
72
73     /**
74      * @ejb.persistence
75      */

76     public abstract void setProperty(String JavaDoc property);
77
78     /**
79      * @ejb.persistence
80      * @ejb.interface-method
81      */

82     public abstract String JavaDoc getValue();
83
84     /**
85      * @ejb.persistence
86      * @ejb.interface-method
87      */

88     public abstract void setValue(String JavaDoc value);
89
90     /**
91      * Creates a new BasePropertyEntityBean object.
92      */

93     public BasePropertyEntityBean() {
94         super();
95     }
96
97     /**
98      * Entity Bean holding data of a raadmin profile.
99      * @return PropertyEntityPK beeing the PrimaryKey for the created entity
100      * @ejb.create-method
101      */

102     public PropertyEntityPK ejbCreate(String JavaDoc id, String JavaDoc property, String JavaDoc value)
103            throws CreateException JavaDoc {
104         PropertyEntityPK pk = new PropertyEntityPK(id,property);
105         setId(id);
106         setProperty(property);
107         setValue(value);
108         return pk;
109     }
110
111     public void ejbPostCreate(String JavaDoc id, String JavaDoc property, String JavaDoc value) {
112         // Do nothing. Required.
113
}
114
115 }
116
Popular Tags