# SimpleTokenBean.ejb Sample

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

## Sample Location

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

BEA_HOME/weblogic81/samples/workshop/SamplesApp/EJBs/messageDriven/

## Sample Source Code

`01 package messageDriven; 02 03 import javax.ejb.*; 04 import weblogic.ejb.*; 05 06 /** 07 * @ejbgen:entity default-transaction="Supports" prim-key-class="messageDriven.SimpleTokenBeanPK" 08 * ejb-name="SimpleToken_M" 09 * data-source-name="cgSampleDataSource" 10 * table-name="ejb_simpletoken" 11 * abstract-schema-name = "SimpleToken" 12 * 13 * @ejbgen:jndi-name 14 * local="ejb.SimpleTokenLocalHome_M" 15 * 16 * @ejbgen:file-generation local-class = "True" local-class-name="SimpleToken_M" local-home = "True" local-home-name="SimpleTokenHome_M" remote-class = "False" remote-home = "False" remote-home-name = "SimpleTokenRemoteHome" remote-class-name = "SimpleTokenRemote" value-class = "True" value-class-name = "SimpleTokenValue" pk-class = "True" 17 * 18 * @ejbgen:finder ejb-ql="SELECT OBJECT(o) from SimpleToken as o" generate-on="Local" signature="Collection findAll()" 19 * @ejbgen:finder weblogic-ejb-ql="SELECT OBJECT(o) from SimpleToken as o ORDERBY o.name" ejb-ql="SELECT OBJECT(o) from SimpleToken as o" generate-on="Local" signature="Collection findAllOrdered()" 20 */ 21 abstract public class SimpleTokenBean 22 extends GenericEntityBean 23 implements EntityBean 24 { 25 /** 26 * @ejbgen:cmp-field primkey-field="true" column="Name" 27 * @ejbgen:local-method 28 */ 29 public abstract int getName(); 30 31 /** 32 * @ejbgen:local-method 33 */ 34 public abstract void setName(int arg); 35 36 /** 37 * @ejbgen:cmp-field primkey-field="true" column="Date" 38 * @ejbgen:local-method 39 */ 40 public abstract String getDate(); 41 42 /** 43 * @ejbgen:local-method 44 */ 45 public abstract void setDate(String arg); 46 47 /** 48 * @ejbgen:cmp-field primkey-field="true" column="EnteredByClass" 49 * @ejbgen:local-method 50 */ 51 public abstract String getEnteredByClass(); 52 53 /** 54 * @ejbgen:local-method 55 */ 56 public abstract void setEnteredByClass(String arg); 57 58 59 /** 60 * @ejbgen:cmp-field primkey-field="true" column="ObjectHash" 61 * @ejbgen:local-method 62 */ 63 public abstract int getObjectHash(); 64 65 /** 66 * @ejbgen:local-method 67 */ 68 public abstract void setObjectHash(int arg); 69 70 public messageDriven.SimpleTokenBeanPK ejbCreate(int Name, java.lang.String Date, java.lang.String EnteredByClass, int ObjectHash) 71 { 72 setName(Name); 73 setDate(Date); 74 setEnteredByClass(EnteredByClass); 75 setObjectHash(ObjectHash); 76 77 return null; // FIXME return PK value 78 } 79 80 public void ejbPostCreate(int Name, java.lang.String Date, java.lang.String EnteredByClass, int ObjectHash) 81 { 82 } 83 } 84`