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.idxandusersql.ejb;
023:
024: import java.util.Collection;
025: import javax.ejb.EntityBean;
026:
027: /**
028: * Test the dbindex feature
029: * @author heiko.rupp@cellent.de
030: * @version $Revision: 57211 $
031: *
032: * @ejb.bean name="CMR2"
033: * type="CMP"
034: * cmp-version="2.x"
035: * view-type="local"
036: * primkey-field="pKey2"
037: *
038: * @ejb.util generate="false"
039: *
040: * @ejb.persistence table-name = "CMR2"
041: *
042: * @jboss.persistence
043: * create-table = "true"
044: * remove-table = "true"
045: *
046: */
047: public abstract class CMR2Bean implements EntityBean {
048:
049: /**
050: * We don't call them, just have them here to
051: * satisfy the cmp-engine
052: * @ejb.create-method
053: */
054: public String ejbCreate() throws javax.ejb.CreateException {
055: return null;
056: }
057:
058: public void ejbPostCreate() {
059:
060: }
061:
062: /**
063: * @ejb.interface-method
064: * @param pKey2
065: */
066: public abstract void setPKey2(String pKey2);
067:
068: /**
069: * @ejb.interface-method
070: * @ejb.persistent-field
071: */
072: public abstract String getPKey2();
073:
074: /**
075: * This field gets a <dbindex/> that we want to
076: * look up in the database to see if the index
077: * was really created on the file.
078: * @ejb.interface-method
079: * @ejb.persistent-field
080: * @todo set the dbindex property here with a modern xdoclet*
081: */
082: public abstract String getFoo2();
083:
084: /**
085: * This one is not indexed
086: * @ejb.interface-method
087: * @ejb.persistent-field
088: */
089: public abstract String getBar2();
090:
091: //
092: // many-many relation to CMR2
093: //
094: /**
095: * @ejb.interface-method
096: */
097: public abstract Collection getIdxs();
098:
099: /**
100: * @ejb.interface-method
101: */
102: public abstract void setIdxs(Collection Idxs);
103:
104: }
|