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.cmp2.jbas1361;
023:
024: import javax.ejb.EntityBean;
025: import javax.ejb.EntityContext;
026: import javax.ejb.RemoveException;
027: import javax.ejb.CreateException;
028: import java.util.Collection;
029:
030: /**
031: * @ejb.bean name="A"
032: * type="CMP"
033: * cmp-version="2.x"
034: * view-type="local"
035: * reentrant="false"
036: * @ejb.pk generate="true"
037: * @ejb.util generate="physical"
038: * @ejb.persistence table-name="A"
039: * @jboss.persistence datasource="${ds.name}"
040: * datasource-mapping="${ds.mapping}"
041: * create-table="${jboss.create.table}"
042: * remove-table="${jboss.remove.table}"
043: * pk-constraint="true"
044: * @ejb:transaction type="Required"
045: */
046: public abstract class ABean implements EntityBean {
047: // CMP accessors --------------------------------------------
048: /**
049: * @ejb.pk-field
050: * @ejb.persistent-field
051: * @ejb.interface-method
052: */
053: public abstract Integer getId();
054:
055: public abstract void setId(Integer id);
056:
057: /**
058: * @ejb.persistent-field
059: * @ejb.interface-method
060: */
061: public abstract String getName();
062:
063: /**
064: * @ejb.interface-method
065: */
066: public abstract void setName(String name);
067:
068: /**
069: * @ejb.interface-method
070: * @ejb.relation name="A-B"
071: * role-name="A-has-B"
072: */
073: public abstract Collection getB();
074:
075: /**
076: * @ejb.interface-method
077: */
078: public abstract void setB(Collection b);
079:
080: /**
081: * @throws javax.ejb.CreateException
082: * @ejb.create-method
083: */
084: public Integer ejbCreate(Integer id, String name)
085: throws CreateException {
086: setId(id);
087: setName(name);
088: return null;
089: }
090:
091: public void ejbPostCreate(Integer id, String name) {
092: }
093:
094: /**
095: * @param ctx The new entityContext value
096: */
097: public void setEntityContext(EntityContext ctx) {
098: }
099:
100: /**
101: * Unset the associated entity context.
102: */
103: public void unsetEntityContext() {
104: }
105:
106: public void ejbActivate() {
107: }
108:
109: public void ejbLoad() {
110: }
111:
112: public void ejbPassivate() {
113: }
114:
115: public void ejbRemove() throws RemoveException {
116: }
117:
118: public void ejbStore() {
119: }
120: }
|