001: /*
002: * JBoss, Home of Professional Open Source
003: * Copyright 2005, JBoss Inc., and individual contributors as indicated
004: * by the @authors tag. See the copyright.txt in the distribution for a
005: * 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.distinct;
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 name="A"
031: * type="CMP"
032: * cmp-version="2.x"
033: * view-type="local"
034: * reentrant="false"
035: * @ejb.pk generate="true"
036: * @ejb.util generate="physical"
037: * @ejb.persistence table-name="A"
038: * @jboss.persistence datasource="${ds.name}"
039: * datasource-mapping="${ds.mapping}"
040: * create-table="${jboss.create.table}"
041: * remove-table="${jboss.remove.table}"
042: * pk-constraint="true"
043: * @ejb:transaction type="Required"
044: * @ejb.finder signature="Collection findByName(java.lang.String i)"
045: * query="select distinct object(o) from A o where o.name=?1"
046: *
047: * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
048: */
049: public abstract class ABean implements EntityBean {
050: // CMP accessors --------------------------------------------
051: /**
052: * @ejb.pk-field
053: * @ejb.persistent-field
054: * @ejb.interface-method
055: */
056: public abstract Integer getId();
057:
058: public abstract void setId(Integer id);
059:
060: /**
061: * @ejb.persistent-field
062: * @ejb.interface-method
063: */
064: public abstract MyData getMyData();
065:
066: /**
067: * @ejb.interface-method
068: */
069: public abstract void setMyData(MyData data);
070:
071: /**
072: * @ejb.persistent-field
073: * @ejb.interface-method
074: */
075: public abstract String getName();
076:
077: /**
078: * @ejb.interface-method
079: */
080: public abstract void setName(String name);
081:
082: /**
083: * @throws javax.ejb.CreateException
084: * @ejb.create-method
085: */
086: public Integer ejbCreate(Integer id, String name)
087: throws CreateException {
088: setId(id);
089: setName(name);
090: return null;
091: }
092:
093: public void ejbPostCreate(Integer id, String name) {
094: }
095:
096: /**
097: * @param ctx The new entityContext value
098: */
099: public void setEntityContext(EntityContext ctx) {
100: }
101:
102: /**
103: * Unset the associated entity context.
104: */
105: public void unsetEntityContext() {
106: }
107:
108: public void ejbActivate() {
109: }
110:
111: public void ejbLoad() {
112: }
113:
114: public void ejbPassivate() {
115: }
116:
117: public void ejbRemove() throws RemoveException {
118: }
119:
120: public void ejbStore() {
121: }
122: }
|