Copyright 2000 Sun Microsystems, Inc., All rights reserved.
What Is an Entity Bean?
that can be expressedasnouns(i.E. Customer inventory item).•
Model permanent data:
entity bean instancevariables read from & stored in DB, gives
inmemory view and manipulation of data
.•Entity beans support
can be re-instantiated fromattributes stored in database:
Lives as long as the data in the database.
Entity BeansAn entity bean represents an object view of business data storedin persistent storage or anexisting application. The bean provides an object wrapper aroundthe data to simplify the task of accessing and manipulating it. This object interface lends itself to software reuse. Forexample, an entity bean representing user account information can be used by ordermanagement, user personalization, and marketing in a uniform way.An entity bean allows shared access from multiple clients and can live past the duration of client’s session with the server. If the state of an entity beanis being updated by a transactionat the time of server crash, the entity bean’s state is automatically reset to the state of the lastcommitted transaction.The most common application for entity beans is for the
representation of data in arelational database
.•A simple entity bean can be defined to represent a
in a database table, where eachinstance of the bean represents a specific row.•
entity beans could represent
views of joined tables
in a database. For example enentity bean could represents a customer’s order and order items.For example, the online bookstore application maintains information about customers,products, and orders using the entity beans
. The Customerbean provides customer details, such as name, address, credit card# of the customer. TheOrders bean provides order details.