tailieunhanh - Entity Bean - Chuyên đề Lập trình Java & J2EE (Chương 15)

An entity bean represents persistent data stored in one row of a database table . When an entity bean is created, the data is written to the appropriate database table row, and if the data in an entity bean is updated, the data in the appropriate database table row is also updated | Entity Bean Chuyên đề Lập trình Java & J2EE Chương 15 Biên soạn: Nguyễn văn Lành Concepts An entity bean represents persistent data stored in one row of a database table . When an entity bean is created, the data is written to the appropriate database table row, and if the data in an entity bean is updated, the data in the appropriate database table row is also updated Entity beans differ from session beans in several ways. Entity beans are persistent: entity bean's state exists beyond the lifetime of the application allow shared access: may be shared by multiple clients have primary keys: unique object identifier may participate in relationships with other entity beans When to Use Entity Beans The bean represents a business entity, not a procedure. For example, CreditCardEJB would be an entity bean CreditCardVerifierEJB would be a session bean. The bean's state must be persistent Types of persistent management Bean-Managed Persistence the bean developer takes . | Entity Bean Chuyên đề Lập trình Java & J2EE Chương 15 Biên soạn: Nguyễn văn Lành Concepts An entity bean represents persistent data stored in one row of a database table . When an entity bean is created, the data is written to the appropriate database table row, and if the data in an entity bean is updated, the data in the appropriate database table row is also updated Entity beans differ from session beans in several ways. Entity beans are persistent: entity bean's state exists beyond the lifetime of the application allow shared access: may be shared by multiple clients have primary keys: unique object identifier may participate in relationships with other entity beans When to Use Entity Beans The bean represents a business entity, not a procedure. For example, CreditCardEJB would be an entity bean CreditCardVerifierEJB would be a session bean. The bean's state must be persistent Types of persistent management Bean-Managed Persistence the bean developer takes responsibility for persistent storage in attributes Container-Managed Persistence persistent attributes are defined as attributes of the bean class and given in the deployment descriptor Container-Managed Persistence The bean developer works with an abstract bean class defines abstract access methods for reading and writing of attributes (During deployment the EJB container generates a derived class that implements all the abstract methods ) Constitution of a entity bean Remote interface: defines the business methods of the bean. Home interface: defines the methods that allow a client to create and find an entity bean Enterprise Bean class: provides the implementation for the business methods, finder methods, home methods Primary key class makes it possible to identify all entity bean identities uniquely Deployment Descriptor: This configuration document defines the bean's runtime attributes, such as its transaction or security attributes Helper classes Remote Interface Each .

TỪ KHÓA LIÊN QUAN