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:
029: /**
030: * @ejb.bean
031: * name="B"
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="B"
039: * @jboss.persistence
040: * datasource="${ds.name}"
041: * datasource-mapping="${ds.mapping}"
042: * create-table="${jboss.create.table}"
043: * remove-table="${jboss.remove.table}"
044: * @ejb:transaction type="Required"
045: */
046: public abstract class BBean 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.pk-field
059: * @ejb.persistent-field
060: * @ejb.interface-method
061: */
062: public abstract String getName();
063:
064: /**
065: * @ejb.interface-method
066: */
067: public abstract void setName(String id);
068:
069: /**
070: * @ejb.interface-method
071: * @ejb.relation
072: * name="A-B"
073: * role-name="B-has-A"
074: * @jboss.relation
075: * fk-constraint="false"
076: * related-pk-field="id"
077: * fk-column="a_id"
078: */
079: public abstract ALocal getA();
080:
081: /**
082: * @ejb.interface-method
083: */
084: public abstract void setA(ALocal a);
085:
086: /**
087: * @ejb.create-method
088: * @throws javax.ejb.CreateException
089: */
090: public BPK ejbCreate(Integer id, String name)
091: throws CreateException {
092: setId(id);
093: setName(name);
094: return null;
095: }
096:
097: public void ejbPostCreate(Integer id, String name) {
098: }
099:
100: /**
101: * @param ctx The new entityContext value
102: */
103: public void setEntityContext(EntityContext ctx) {
104: }
105:
106: /**
107: * Unset the associated entity context.
108: */
109: public void unsetEntityContext() {
110: }
111:
112: public void ejbActivate() {
113: }
114:
115: public void ejbLoad() {
116: }
117:
118: public void ejbPassivate() {
119: }
120:
121: public void ejbRemove() throws RemoveException {
122: }
123:
124: public void ejbStore() {
125: }
126: }
|