Top ten web hosting - The bean class must declare accessor (set and
The bean class must declare accessor (set and get) methods for each persistent and relationship field defined in the abstract persistence schema of the deployment descriptor. In truth, it s somewhat of a chicken-and-egg scenario, since the container tool needs both the abstract accessor methods (defined in the entity bean class) and the XML elements of the deployment descriptor to fully describe the bean s persistence schema. In this book, the entity bean class is always defined before the XML elements, because it s a more natural approach to developing entity beans. Here is a very simple definition of the CustomerBean class which is developed and packaged for deployment by the bean developer. import javax.ejb.EntityContext; public abstract class CustomerBean implements javax.ejb.EntityBean { public Integer ejbCreate(Integer id){ setId(id); return null; } public void ejbPostCreate(Integer id){ } // abstract accessor methods public abstract Integer getId(); public abstract void setId(Integer id); public abstract String getLastName(); public abstract void setLastName(String lname); public abstract String getFirstName(); public abstract void setFirstName(String fname); // standard call back methods public void setEntityContext(EntityContext ec){} public void unsetEntityContext(){} public void ejbLoad(){} public void ejbStore(){} public void ejbActivate(){} public void ejbPassivate(){} public void ejbRemove(){} } The CustomerBean class is defined as an abstract class. This is required by CMP 2.0 to reinforce the idea that the CustomerBean is not deployed directly into the container system. Since abstract classes cannot be instantiated, the bean class must be subclassed by a persistence class generated by the deployment tool in order to be deployed. Also, the accessor methods are themselves Copyright (c) 2001 O’Reilly & Associates
Have you tried other web hosting companies and found out that their focus and your focus are in clash?Check our filemaker web hosting services.