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: /**
025: * CMP layer for bank/Account.
026: */
027: public abstract class AccountCMP extends
028: org.jboss.test.banknew.ejb.AccountBean implements
029: javax.ejb.EntityBean {
030:
031: public org.jboss.test.banknew.interfaces.AccountData getData() {
032: org.jboss.test.banknew.interfaces.AccountData dataHolder = null;
033: try {
034: dataHolder = new org.jboss.test.banknew.interfaces.AccountData();
035:
036: dataHolder.setId(getId());
037: dataHolder.setCustomerId(getCustomerId());
038: dataHolder.setType(getType());
039: dataHolder.setBalance(getBalance());
040:
041: } catch (RuntimeException e) {
042: throw new javax.ejb.EJBException(e);
043: }
044:
045: return dataHolder;
046: }
047:
048: public void setData(
049: org.jboss.test.banknew.interfaces.AccountData dataHolder) {
050: try {
051: setCustomerId(dataHolder.getCustomerId());
052: setType(dataHolder.getType());
053: setBalance(dataHolder.getBalance());
054:
055: } catch (Exception e) {
056: throw new javax.ejb.EJBException(e);
057: }
058: }
059:
060: public void ejbLoad() throws java.rmi.RemoteException {
061: super .ejbLoad();
062: }
063:
064: public void ejbStore() throws java.rmi.RemoteException {
065: super .ejbStore();
066: }
067:
068: public void ejbActivate() throws java.rmi.RemoteException {
069: super .ejbActivate();
070: }
071:
072: public void ejbPassivate() throws java.rmi.RemoteException {
073: super .ejbPassivate();
074:
075: }
076:
077: public void setEntityContext(javax.ejb.EntityContext ctx)
078: throws java.rmi.RemoteException {
079: super .setEntityContext(ctx);
080: }
081:
082: public void unsetEntityContext() throws java.rmi.RemoteException {
083: super .unsetEntityContext();
084: }
085:
086: public void ejbRemove() throws java.rmi.RemoteException,
087: javax.ejb.RemoveException {
088: super .ejbRemove();
089:
090: }
091:
092: public abstract java.lang.String getId();
093:
094: public abstract void setId(java.lang.String id);
095:
096: public abstract java.lang.String getCustomerId();
097:
098: public abstract void setCustomerId(java.lang.String customerId);
099:
100: public abstract int getType();
101:
102: public abstract void setType(int type);
103:
104: public abstract float getBalance();
105:
106: public abstract void setBalance(float balance);
107:
108: }
|