KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > idxandusersql > ejb > DBIndexTestBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.cmp2.idxandusersql.ejb;
23
24 import java.util.Collection JavaDoc;
25 import javax.ejb.EntityBean JavaDoc;
26
27 /**
28  * Test the dbindex feature
29  * @author heiko.rupp@cellent.de
30  * @version $Revision: 37406 $
31  *
32  * @ejb.bean name="DBIndexTest"
33  * type="CMP"
34  * cmp-version="2.x"
35  * view-type="local"
36  * primkey-field="pKey"
37  *
38  * @ejb.util generate="false"
39  *
40  * @ejb.persistence table-name = "DBIndexTest"
41  *
42  * @jboss.persistence
43  * create-table = "true"
44  * remove-table = "true"
45  *
46  */

47 public abstract class DBIndexTestBean implements EntityBean JavaDoc
48 {
49
50    /**
51     * We don't call them, just have them here to
52     * satisfy the cmp-engine
53     * @ejb.create-method
54     */

55    public String JavaDoc ejbCreate() throws javax.ejb.CreateException JavaDoc
56    {
57       return null;
58    }
59
60    public void ejbPostCreate()
61    {
62
63    }
64
65    /**
66     * @ejb.interface-method
67     * @param pKey
68     */

69    public abstract void setPKey(String JavaDoc pKey);
70
71    /**
72     * @ejb.interface-method
73     * @ejb.persistent-field
74     */

75    public abstract String JavaDoc getPKey();
76
77    /**
78     * This field gets a <dbindex/> that we want to
79     * look up in the database to see if the index
80     * was really created on the file.
81     * @ejb.interface-method
82     * @ejb.persistent-field
83     * @todo set the dbindex property here with a modern xdoclet*
84     */

85    public abstract String JavaDoc getFoo();
86
87    /**
88     * This field gets an index via the
89     * <post-create-sql/> setting in jbosscmp-jdbc.xml file
90     * @ejb.interface-method
91     * @ejb.persistent-field
92     * @todo set the dbindex property here with a modern xdoclet
93     */

94    public abstract String JavaDoc getBar();
95
96    /**
97     * This field is not indexed
98     * @ejb.interface-method
99     * @ejb.persistent-field
100     */

101    public abstract String JavaDoc getBaz();
102
103    //
104
// 1-many relation to CMR1
105
// the foreign key on CMR1 gets an index
106
/**
107     * @ejb.interface-method
108     */

109    public abstract Collection JavaDoc getCmr1s();
110
111    /**
112     * @ejb.interface-method
113     */

114    public abstract void setCmr1s(Collection JavaDoc cmr1s);
115
116    //
117
// many-many relation to CMR2
118
//
119
/**
120     * @ejb.interface-method
121     */

122    public abstract Collection JavaDoc getCmr2s();
123
124    /**
125     * @ejb.interface-method
126     */

127    public abstract void setCmr2s(Collection JavaDoc cmr2s);
128    
129
130 }
131
Popular Tags