KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > foedeployer > ejb > simple > SecretBean


1 /*
2 * JBoss, the OpenSource EJB server
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */

7 package org.jboss.test.foedeployer.ejb.simple;
8
9 import javax.ejb.CreateException JavaDoc;
10 import javax.ejb.EntityBean JavaDoc;
11 import javax.ejb.EntityContext JavaDoc;
12 import javax.ejb.RemoveException JavaDoc;
13
14 /**
15  * Models a top secret.
16  *
17  * @ejb.bean
18  * name="Secret"
19  * generate="true"
20  * view-type="both"
21  * type="CMP"
22  * jndi-name="ejb/Secret"
23  * local-jndi-name="ejb/SecretLocal"
24  * reentrant="False"
25  * cmp-version="2.x"
26  * primkey-field="secretKey"
27  *
28  * @ejb.pk
29  * class="java.lang.String"
30  * generate="false"
31  *
32  * @ejb.transaction type="Required"
33  *
34  * @@ejb.persistence table-name="SECRET"
35  * @weblogic:table-name secret
36  *
37  * @author <a HREF="mailto:loubyansky@hotmail.com">Alex Loubyansky</a>
38  */

39 public abstract class SecretBean
40    implements EntityBean JavaDoc
41 {
42    // Attributes ----------------------------------------------------
43
private EntityContext JavaDoc mContext;
44    
45    // CMP Accessors -------------------------------------------------
46
/**
47     * Secret key: primary key field
48     *
49     * @ejb.pk-field
50     * @ejb.persistent-field
51     * @ejb.interface-method
52     *
53     * xdoclet needs to be updated
54     * @@ejb.persistence
55     * column-name="username"
56     * jdbc-type="VARCHAR"
57     * sql-type="VARCHAR(32)"
58     *
59     * @weblogic:dbms-column secret_key
60     */

61    public abstract String JavaDoc getSecretKey();
62    public abstract void setSecretKey( String JavaDoc secretKey );
63    
64    /**
65     * Secret: persistent field
66     *
67     * @ejb.persistent-field
68     * @ejb.interface-method
69     *
70     * xdoclet needs to be updated
71     * @@ejb.persistence
72     * column-name="password"
73     *
74     * @weblogic:dbms-column secret
75     */

76    public abstract String JavaDoc getSecret();
77    /**
78     * @ejb.interface-method
79     */

80    public abstract void setSecret( String JavaDoc secret );
81    
82    // EntityBean Implementation -------------------------------------
83
/**
84     * @ejb.create-method
85     */

86    public String JavaDoc ejbCreate( String JavaDoc secretKey, String JavaDoc secret )
87       throws CreateException JavaDoc
88    {
89       setSecretKey(secretKey);
90       setSecret(secret);
91       return null;
92    }
93
94    public void ejbPostCreate( String JavaDoc secretKey, String JavaDoc secret ) { }
95
96    public void setEntityContext( EntityContext JavaDoc ctx )
97    {
98       mContext = ctx;
99    }
100    
101    public void unsetEntityContext()
102    {
103       mContext = null;
104    }
105    
106    public void ejbRemove() throws RemoveException JavaDoc { }
107    public void ejbActivate() { }
108    public void ejbPassivate() { }
109    public void ejbLoad() { }
110    public void ejbStore() { }
111 }
112
Popular Tags