Overview:
entity beans are different from the session bean, and the entity bean is persistent, even if the application ends, it still exists. It allows shared access, with a primary key.
Composition:
1) native (local) interface
Local access to EJBS is only available if the EJB is in the same application as the customer. When used, it can be used concurrently with the remote interface.
It optimizes access to EJBS, bypassing RMI.
2) Remote interface
The biggest difference from the local interface is that the remote interface can be accessed from anywhere .
Named:
use a normal name if you use only one of the local or remote interfaces. such as HelloWorld and Helloworldhome.
If you are using both interfaces, use ' Local ' or ' Remote ' as the interface prefix. For example
Helloworldlocal,helloworldLocalHome
Helloworldremote,HelloWorldRemoteHome.
3) Primary Key
An EJB that uniquely identifies an entity. Consists of one or more persistent fields of an entity bean, which is specified in the deployment description file.
Type:
1) CMP Entity bean
-- container-managed persistent entity Bean
Characteristics:
Controlled by the container, the container can achieve advanced data buffering and complex relationships between ejbs.
2) BMP Entity Bean
--The operation code for the data is provided by the Bean author.
Characteristics:
You need to write all the persistence logic manually in the bean, which makes debugging difficult. However, it can represent complex persistent data.
Two types of comparisons:
Life cycle:
The life cycle of an entity bean has three states:Does not Exist --No,pooled--into the pool, ready--in place.
Pool pooled is the move of the created entity bean to the available instance pool.
The conversion and method calls between these three states are as follows:
Summary:
The content of the entity bean is also very miscellaneous, much with the previously learned things, the use of comparative analysis, it will be much easier. such as the comparison between the local interface and the remote interface, CMP and BMP comparison.
13 Technology--EJB Entity beans from the Java EE