1 /** 2 * Copyright (c) 2004 Red Hat, Inc. All rights reserved. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 17 * USA 18 * 19 * Component of: Red Hat Application Server 20 * 21 * Initial Developers: Aizaz Ahmed 22 * Vivek Lakshmanan 23 * Andrew Overholt 24 * Matthew Wringe 25 * 26 */ 27 28 /* 29 * TypeBean.java 30 * 31 * Created on Aug 13, 2004 32 * 33 */ 34 package olstore.entity; 35 36 import javax.ejb.EntityBean; 37 38 /** 39 * @ejb.bean name="Type" 40 * description="Each Item bean is of a certain Type." 41 * type="CMP" 42 * primkey-field="name" 43 * schema="olstore_type" 44 * reentrant="false" 45 * cmp-version="2.x" 46 * view-type="local" 47 * local-jndi-name="TypeLocal_L" 48 * 49 * @ejb.relation 50 * name="Item-Type" 51 * target-ejb="Item" 52 * role-name="Type-has-many-Items" 53 * 54 * @ejb.transaction 55 * type="Required" 56 * 57 *-- 58 * This is needed for JOnAS. 59 * If you are not using JOnAS you can safely remove the tags below. 60 * @jonas.bean ejb-name="Type" 61 * jndi-name="TypeLocal" 62 * @jonas.jdbc-mapping jndi-name="jdbc_1" jdbc-table-name="olstore_type" 63 * -- 64 * 65 * @ejb.persistence 66 * 67 * @ejb.finder 68 * query="SELECT OBJECT(a) FROM olstore_type as a" 69 * signature="java.util.Collection findAll()" 70 * 71 * @ejb.finder 72 * query="SELECT OBJECT(a) FROM olstore_type as a WHERE a.name = ?1" 73 * signature="olstore.entity.Type findByName(java.lang.String name)" 74 * 75 *-- 76 * This is needed for JOnAS. 77 * If you are not using JOnAS you can safely remove the tags below. 78 * @jonas.finder-method-jdbc-mapping method-name="findAll" 79 * jdbc-where-clause="" 80 * @jonas.jdbc-mapping jndi-name="jdbc_1" 81 * jdbc-table-name="olstore_type" 82 * 83 *-- 84 * 85 **/ 86 87 public abstract class TypeBean implements EntityBean { 88 89 /** 90 * The ejbCreate method. 91 * 92 * @ejb.create-method 93 */ 94 public java.lang.String ejbCreate(java.lang.String name) throws javax.ejb.CreateException { 95 setName (name); 96 return null; 97 } 98 99 /** 100 * The container invokes this method immediately after it calls ejbCreate. 101 * 102 */ 103 public void ejbPostCreate(java.lang.String name) throws javax.ejb.CreateException { 104 } 105 106 /** 107 * Returns the name 108 * @return the name 109 * 110 * @ejb.persistent-field 111 * @ejb.persistence 112 * column-name="name" 113 * sql-type="VARCHAR" 114 * @ejb.pk-field 115 * @ejb.interface-method 116 * 117 */ 118 public abstract java.lang.String getName(); 119 120 /** 121 * Sets the name 122 * 123 * @param java.lang.String the new name value 124 * 125 * @ejb.interface-method 126 */ 127 public abstract void setName(java.lang.String name); 128 129 /** 130 * Returns the properties 131 * @return the properties 132 * 133 * @ejb.interface-method 134 * 135 * @ejb.relation 136 * name="Type-Property" 137 * target-ejb="Property" 138 * role-name="Type-has-many-Properties" 139 * 140 */ 141 public abstract java.util.Collection getProperties(); 142 143 /** 144 * Sets the properties 145 * 146 * @param java.util.Collection the new properties value 147 * 148 * @ejb.interface-method 149 */ 150 public abstract void setProperties(java.util.Collection properties); 151 152 } 153