001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.foedeployer.ejb.simple;
023:
024: import javax.ejb.CreateException;
025: import javax.ejb.EntityBean;
026: import javax.ejb.EntityContext;
027: import javax.ejb.RemoveException;
028:
029: /**
030: * Models a top secret.
031: *
032: * @ejb.bean
033: * name="Secret"
034: * generate="true"
035: * view-type="both"
036: * type="CMP"
037: * jndi-name="ejb/Secret"
038: * local-jndi-name="ejb/SecretLocal"
039: * reentrant="False"
040: * cmp-version="2.x"
041: * primkey-field="secretKey"
042: *
043: * @ejb.pk
044: * class="java.lang.String"
045: * generate="false"
046: *
047: * @ejb.transaction type="Required"
048: *
049: * @@ejb.persistence table-name="SECRET"
050: * @weblogic:table-name secret
051: *
052: * @author <a href="mailto:loubyansky@hotmail.com">Alex Loubyansky</a>
053: */
054: public abstract class SecretBean implements EntityBean {
055: // Attributes ----------------------------------------------------
056: private EntityContext mContext;
057:
058: // CMP Accessors -------------------------------------------------
059: /**
060: * Secret key: primary key field
061: *
062: * @ejb.pk-field
063: * @ejb.persistent-field
064: * @ejb.interface-method
065: *
066: * xdoclet needs to be updated
067: * @@ejb.persistence
068: * column-name="username"
069: * jdbc-type="VARCHAR"
070: * sql-type="VARCHAR(32)"
071: *
072: * @weblogic:dbms-column secret_key
073: */
074: public abstract String getSecretKey();
075:
076: public abstract void setSecretKey(String secretKey);
077:
078: /**
079: * Secret: persistent field
080: *
081: * @ejb.persistent-field
082: * @ejb.interface-method
083: *
084: * xdoclet needs to be updated
085: * @@ejb.persistence
086: * column-name="password"
087: *
088: * @weblogic:dbms-column secret
089: */
090: public abstract String getSecret();
091:
092: /**
093: * @ejb.interface-method
094: */
095: public abstract void setSecret(String secret);
096:
097: // EntityBean Implementation -------------------------------------
098: /**
099: * @ejb.create-method
100: */
101: public String ejbCreate(String secretKey, String secret)
102: throws CreateException {
103: setSecretKey(secretKey);
104: setSecret(secret);
105: return null;
106: }
107:
108: public void ejbPostCreate(String secretKey, String secret) {
109: }
110:
111: public void setEntityContext(EntityContext ctx) {
112: mContext = ctx;
113: }
114:
115: public void unsetEntityContext() {
116: mContext = null;
117: }
118:
119: public void ejbRemove() throws RemoveException {
120: }
121:
122: public void ejbActivate() {
123: }
124:
125: public void ejbPassivate() {
126: }
127:
128: public void ejbLoad() {
129: }
130:
131: public void ejbStore() {
132: }
133: }
|