# ManufacturerBean_F.ejb Sample

This topic inludes the source code for the ManufacturerBean_F.ejb Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/EJBs/finderMethods/

## Sample Source Code

`01 package finderMethods; 02 03 import java.util.Collection; 04 import javax.ejb.CreateException; 05 06 import weblogic.ejb.GenericEntityBean; 07 08 /** 09 * @ejbgen:entity default-transaction="Supports" concurrency-strategy="Database" 10 * ejb-name = "ManufacturerBean_F" 11 * data-source-name = "cgSampleDataSource" 12 * table-name = "EJB_MANUFACTURER" 13 * prim-key-class = "java.lang.Integer" 14 * 15 * @ejbgen:jndi-name 16 * local = "ejb.ManufacturerBean_FHome" 17 * 18 * @ejbgen:file-generation local-class = "true" local-class-name = "ManufacturerBean_FLocal" local-home = "true" local-home-name = "ManufacturerBean_FHome" remote-class = "false" remote-class-name = "ManufacturerBean_FRemote" remote-home = "false" remote-home-name = "ManufacturerBean_FRemoteHome" value-class = "true" value-class-name = "ManufacturerVO" pk-class = "true" 19 * @ejbgen:relation role-name="ManufacturerBean_F-has-ItemsBean_Fs" cmr-field="items" target-ejb="ItemsBean_F" multiplicity="One" name="ItemsBean_F-ManufacturerBean_F" 20 * @ejbgen:finder ejb-ql="SELECT OBJECT(o) from ManufacturerBean_F as o" generate-on="Local" signature="Collection findAll()" 21 * @ejbgen:finder ejb-ql="SELECT OBJECT(m) from ItemsBean_F as o, IN(o.manufacturer) AS m" generate-on="Local" signature="Collection findAllManufacturers()" 22 * @ejbgen:finder ejb-ql="SELECT DISTINCT OBJECT(m) from ItemsBean_F as o, IN(o.manufacturer) AS m" generate-on="Local" signature="Collection findDistinctManufacturer()" 23 * @ejbgen:finder ejb-ql="SELECT OBJECT(o) from ManufacturerBean_F as o WHERE o.usManufacturer = 1" generate-on="Local" signature="Collection findUSManufacturer()" 24 * @ejbgen:finder ejb-ql="SELECT OBJECT(o) from ManufacturerBean_F as o WHERE o.items IS EMPTY" generate-on="Local" signature="Collection findWithoutItems()" 25 * @ejbgen:finder ejb-ql="SELECT OBJECT(o) from ManufacturerBean_F as o, IN (o.items) AS allItems, ItemsBean_F oneItem WHERE oneItem.itemname = ?1 AND oneItem MEMBER OF allItems" generate-on="Local" signature="Collection findManufacturerOfItem(java.lang.String itemname)" 26 */ 27 28 public abstract class ManufacturerBean_F 29 extends GenericEntityBean 30 { 31 32 33 /** 34 * @ejbgen:cmp-field ordering-number="10" column = "MANUFACTURER_ID" 35 * primkey-field="true" 36 * @ejbgen:local-method 37 */ 38 public abstract Integer getManufacturerId(); 39 /** 40 * @ejbgen:local-method 41 */ 42 public abstract void setManufacturerId(Integer val); 43 44 /** 45 * @ejbgen:cmp-field column = "MANUFACTURERNAME" 46 * @ejbgen:local-method 47 */ 48 public abstract String getManufacturername(); 49 /** 50 * @ejbgen:local-method 51 */ 52 public abstract void setManufacturername(String val); 53 54 /** 55 * @ejbgen:cmp-field column = "US_MANUFACTURER" 56 * @ejbgen:local-method 57 */ 58 public abstract int getUsManufacturer(); 59 /** 60 * @ejbgen:local-method 61 */ 62 public abstract void setUsManufacturer(int val); 63 64 65 /** 66 * @ejbgen:cmr-field 67 * @ejbgen:local-method 68 */ 69 public abstract java.util.Collection getItems(); 70 71 /** 72 * @ejbgen:local-method 73 */ 74 public abstract void setItems(java.util.Collection arg); 75 76 /** 77 * @ejbgen:local-method 78 */ 79 public java.lang.String toString() 80 { 81 return "["+getManufacturerId().toString()+","+getManufacturername()+","+getUsManufacturer()+"]"; 82 } 83 84 public java.lang.Integer ejbCreate(java.lang.Integer ManufacturerId, java.lang.String Manufacturername, int UsManufacturer) 85 { 86 setManufacturerId(ManufacturerId); 87 setManufacturername(Manufacturername); 88 setUsManufacturer(UsManufacturer); 89 90 return null; // FIXME return PK value 91 } 92 93 public void ejbPostCreate(java.lang.Integer ManufacturerId, java.lang.String Manufacturername, int UsManufacturer) 94 { 95 } 96 }`