An entity bean consists of 4 groups of methods:
1. create methods: To create a new instance of a CMP entity bean, and therefore insert data into the database, the create() method on the bean's home interface must be invoked. They look like this: EntityBeanClass ejbCreateXXX(parameters), where EntityBeanClass is an Entity Bean you are trying to instantiate, ejbCreateXXX(parameters) methods are used for creating Entity Bean instances according to the parameters specified and to some programmer-defined conditions.
A bean's home interface may declare zero or more create() methods, each of which must have corresponding ejbCreate() and ejbPostCreate() methods in the bean class. These creation methods are linked at run time, so that when a create() method is invoked on the home interface, the container delegates the invocation to the corresponding ejbCreate() and ejbPostCreate() methods on the bean class.
2. finder methods: The methods in the home interface that begin with "find" are called the find methods. These are used to query the EJB server for specific entity beans, based on the name of the method and arguments passed. Unfortunately, there is no standard query language defined for find methods, so each vendor will implement the find method differently. In CMP entity beans, the find methods are not implemented with matching methods in the bean class; containers implement them when the bean is deployed in a vendor specific manner. The deployer will use vendor specific tools to tell the container how a particular find method should behave. Some vendors will use object-relational mapping tools to define the behavior of a find method while others will simply require the deployer to enter the appropriate SQL command.
There are two basic kinds of find methods: single-entity and multi-entity. Single-entity find methods return a remote reference to the one specific entity bean that matches the find request. If no entity beans are found, the method throws an ObjectNotFoundException . Every entity bean must define the single-entity find method with the method name findByPrimaryKey(), which takes the bean's primary key type as an argument.
The multi-entity find methods return a collection ( Enumeration or Collection type) of entities that match the find request. If no entities are found, the multi-entity find returns an empty collection.
3. remove methods: These methods (you may have up to 2 remove methods, or don't have them at all) allow the client to physically remove Entity beans by specifying either Handle or a Primary Key for the Entity Bean.
4. home methods: These methods are designed and implemented by a developer, and EJB specification doesn't have any requirements for them except the need to throw a RemoteException is each home method.
| Answered By : |
null Replied Date : Feb 16 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 28 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 21 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 1 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 1 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Oct 30 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 13 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 13 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Sep 10 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jun 18 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jun 18 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jun 18 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : May 12 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Apr 12 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 30 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 30 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 20 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 18 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 18 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 16 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 9 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 5 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Mar 5 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Feb 22 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 30 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 25 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 25 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 21 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 20 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 20 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 13 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 3 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 3 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 3 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Jan 2 2011 |
| Answer : |
|
| Answered By : |
null Replied Date : Dec 14 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 22 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 23 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 21 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 18 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 13 2010 |
| Answer : |
|
| Answered By : |
null Replied Date : May 8 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Jul 30 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 6 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Aug 21 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Oct 10 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Nov 7 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : Dec 25 2012 |
| Answer : |
|
| Answered By : |
null Replied Date : May 29 2013 |
| Answer : |
|