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.banknew.ejb;
023:
024: import javax.ejb.CreateException;
025:
026: import org.jboss.test.banknew.interfaces.BankData;
027: import org.jboss.test.banknew.interfaces.BankPK;
028: import org.jboss.test.util.ejb.EntitySupport;
029:
030: /**
031: * The Session bean represents a bank.
032: *
033: * @author Andreas Schaefer
034: * @version $Revision: 57211 $
035: *
036: * @ejb:bean name="bank/Bank"
037: * display-name="Bank Entity"
038: * type="CMP"
039: * view-type="remote"
040: * jndi-name="ejb/bank/Bank"
041: * schema="Bank"
042: *
043: * @ejb:interface extends="javax.ejb.EJBObject"
044: *
045: * @ejb:home extends="javax.ejb.EJBHome"
046: *
047: * @ejb:pk extends="java.lang.Object"
048: *
049: * @ejb:data-object extends="java.lang.Object"
050: * generate="true"
051: *
052: * @ejb:finder signature="java.util.Collection findAll()"
053: * query="SELECT OBJECT(o) FROM Bank AS o"
054: *
055: * @ejb:transaction type="Required"
056: *
057: * @jboss:table-name table-name="New_Bank"
058: *
059: * @jboss:create-table create="true"
060: *
061: * @jboss:remove-table remove="true"
062: */
063: public abstract class BankBean extends EntitySupport {
064: // Constants -----------------------------------------------------
065:
066: // Attributes ----------------------------------------------------
067:
068: // Static --------------------------------------------------------
069:
070: // Constructors --------------------------------------------------
071:
072: // Public --------------------------------------------------------
073:
074: /**
075: * @ejb:persistent-field
076: * @ejb:pk-field
077: *
078: * @jboss:column-name name="Id"
079: **/
080: public abstract String getId();
081:
082: public abstract void setId(String pId);
083:
084: /**
085: * @ejb:persistent-field
086: *
087: * @jboss:column-name name="Name"
088: **/
089: public abstract String getName();
090:
091: public abstract void setName(String pName);
092:
093: /**
094: * @ejb:persistent-field
095: *
096: * @jboss:column-name name="Address"
097: **/
098: public abstract String getAddress();
099:
100: public abstract void setAddress(String pAddress);
101:
102: /**
103: * @ejb:interface-method view-type="remote"
104: **/
105: public abstract void setData(BankData pData);
106:
107: /**
108: * @ejb:interface-method view-type="remote"
109: **/
110: public abstract BankData getData();
111:
112: // EntityBean implementation -------------------------------------
113:
114: /**
115: * @ejb:create-method view-type="remote"
116: **/
117: public BankPK ejbCreate(String pName, String pAddress)
118: throws CreateException {
119: setId("Bank ( " + System.currentTimeMillis() + " )");
120: setName(pName);
121: setAddress(pAddress);
122:
123: return null;
124: }
125:
126: public void ejbPostCreate(String pName, String pAddress)
127: throws CreateException {
128: }
129: }
130:
131: /*
132: * $Id: BankBean.java 57211 2006-09-26 12:39:46Z dimitris@jboss.org $
133: * Currently locked by:$Locker$
134: * Revision:
135: * $Log$
136: * Revision 1.2.16.1 2005/10/29 05:04:35 starksm
137: * Update the LGPL header
138: *
139: * Revision 1.2 2002/05/06 00:07:37 danch
140: * Added ejbql query specs, schema names
141: *
142: * Revision 1.1 2002/05/04 01:08:25 schaefera
143: * Added new Stats classes (JMS related) to JSR-77 implemenation and added the
144: * bank-new test application but this does not work right now properly but
145: * it is not added to the default tests so I shouldn't bother someone.
146: *
147: * Revision 1.1.2.5 2002/04/30 01:21:23 schaefera
148: * Added some fixes to the marathon test and a windows script.
149: *
150: * Revision 1.1.2.4 2002/04/29 21:05:17 schaefera
151: * Added new marathon test suite using the new bank application
152: *
153: * Revision 1.1.2.3 2002/04/17 05:07:24 schaefera
154: * Redesigned the banknew example therefore to a create separation between
155: * the Entity Bean (CMP) and the Session Beans (Business Logic).
156: * The test cases are redesigned but not finished yet.
157: *
158: */
|