Code snippet for Company Entity Bean public class CompanyBean extends CompanyStruct implements EntityBean { EntityContext entityContext; //all fields in CompanyStruct are available for CMP public Integer ejbCreate(CompanyStruct Struct) throws CreateException { this.comId = struct.comId; //set the PRimary key setData(struct);//this removes some redundant code return null; }