001: /**
002: * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017: * USA
018: *
019: * Component of: Red Hat Application Server
020: *
021: * Initial Developers: Aizaz Ahmed
022: * Vivek Lakshmanan
023: * Andrew Overholt
024: * Matthew Wringe
025: *
026: */package olstore.entity;
027:
028: import javax.ejb.EntityBean;
029:
030: /**
031: * @ejb.bean name="Type"
032: * description="Each Item bean is of a certain Type."
033: * type="CMP"
034: * primkey-field="name"
035: * schema="olstore_type"
036: * reentrant="false"
037: * cmp-version="2.x"
038: * view-type="local"
039: * local-jndi-name="TypeLocal_L"
040: *
041: * @ejb.relation
042: * name="Item-Type"
043: * target-ejb="Item"
044: * role-name="Type-has-many-Items"
045: *
046: * @ejb.transaction
047: * type="Required"
048: *
049: *--
050: * This is needed for JOnAS.
051: * If you are not using JOnAS you can safely remove the tags below.
052: * @jonas.bean ejb-name="Type"
053: * jndi-name="TypeLocal"
054: * @jonas.jdbc-mapping jndi-name="jdbc_1" jdbc-table-name="olstore_type"
055: * --
056: *
057: * @ejb.persistence
058: *
059: * @ejb.finder
060: * query="SELECT OBJECT(a) FROM olstore_type as a"
061: * signature="java.util.Collection findAll()"
062: *
063: * @ejb.finder
064: * query="SELECT OBJECT(a) FROM olstore_type as a WHERE a.name = ?1"
065: * signature="olstore.entity.Type findByName(java.lang.String name)"
066: *
067: *--
068: * This is needed for JOnAS.
069: * If you are not using JOnAS you can safely remove the tags below.
070: * @jonas.finder-method-jdbc-mapping method-name="findAll"
071: * jdbc-where-clause=""
072: * @jonas.jdbc-mapping jndi-name="jdbc_1"
073: * jdbc-table-name="olstore_type"
074: *
075: *--
076: *
077: **/
078:
079: public abstract class TypeBean implements EntityBean {
080:
081: /**
082: * The ejbCreate method.
083: *
084: * @ejb.create-method
085: */
086: public java.lang.String ejbCreate(java.lang.String name)
087: throws javax.ejb.CreateException {
088: setName(name);
089: return null;
090: }
091:
092: /**
093: * The container invokes this method immediately after it calls ejbCreate.
094: *
095: */
096: public void ejbPostCreate(java.lang.String name)
097: throws javax.ejb.CreateException {
098: }
099:
100: /**
101: * Returns the name
102: * @return the name
103: *
104: * @ejb.persistent-field
105: * @ejb.persistence
106: * column-name="name"
107: * sql-type="VARCHAR"
108: * @ejb.pk-field
109: * @ejb.interface-method
110: *
111: */
112: public abstract java.lang.String getName();
113:
114: /**
115: * Sets the name
116: *
117: * @param java.lang.String the new name value
118: *
119: * @ejb.interface-method
120: */
121: public abstract void setName(java.lang.String name);
122:
123: /**
124: * Returns the properties
125: * @return the properties
126: *
127: * @ejb.interface-method
128: *
129: * @ejb.relation
130: * name="Type-Property"
131: * target-ejb="Property"
132: * role-name="Type-has-many-Properties"
133: *
134: */
135: public abstract java.util.Collection getProperties();
136:
137: /**
138: * Sets the properties
139: *
140: * @param java.util.Collection the new properties value
141: *
142: * @ejb.interface-method
143: */
144: public abstract void setProperties(java.util.Collection properties);
145:
146: }
|