User Code: EJB with Composite Primary Key in ODBMS

This Java user offers us the source code for implementing the Composite Primary Key of an Entity Bean, along with with the object in the database.

provided by: 
Originally published at Internet.com


As you know, Enterprise Java Beans (EJB) technology provides a format for highly specialized business logic components, wherein the EJB is just a collection of java classes and XML files, bundled into a single unit. The Java classes must follow certain rules and provide certain callback methods. Of the various types of the EJB, the most commonly used one is the Entity Bean, which always represents the shared, transactional data in your application. The persistence of an Entity Bean can be managed by the Bean Programmer (BMP) or by the container itself (CMP). As I mentioned above, certain Java classes are to be implemented along with the certain rules for the Entity Bean for any CMP or BMP. One of these is the Primary Key class. I am going to talk about this class.

Why Primary Key Class



Every Entity Bean has a primary key that represents a unique identity and must be represented by a class known as primary key class. This class must contain the information necessary to find that entity in the persistent store. It is used internally by the EJB container or client to find a particular instance of the entity. Hence, this class must follow certain rules.

1. It must have a unique value within the set of all beans of a particular type. 2. It must provide suitable implementation of hashCode() and equals() methods. 3. It must be serializable...

Read article at Internet.com site
Related Articles
- An Overview of Java Database Connectivity
We examine the basic steps required to handle JDBC using javax.swing for creating user interfaces. If you're new to object-oriented programming to databases in Java, this will set you off on the right path.
- Exploring the Oslo Repository
- Using More Advanced JDBC Features
- Practical Uses for DTS
- The Elements of a Database
- Building Microsoft Oslo Models
- Replication and Microsoft SQL Server 2000
Regional Articles
- User Code: EJB with Composite Primary Key in ODBMS Alabama
- User Code: EJB with Composite Primary Key in ODBMS Alaska
- User Code: EJB with Composite Primary Key in ODBMS Arizona
- User Code: EJB with Composite Primary Key in ODBMS Arkansas
- User Code: EJB with Composite Primary Key in ODBMS California
- User Code: EJB with Composite Primary Key in ODBMS Colorado
- User Code: EJB with Composite Primary Key in ODBMS Connecticut
- User Code: EJB with Composite Primary Key in ODBMS DC
- User Code: EJB with Composite Primary Key in ODBMS Delaware
- User Code: EJB with Composite Primary Key in ODBMS Florida
- User Code: EJB with Composite Primary Key in ODBMS Georgia
- User Code: EJB with Composite Primary Key in ODBMS Hawaii
- User Code: EJB with Composite Primary Key in ODBMS Idaho
- User Code: EJB with Composite Primary Key in ODBMS Illinois
- User Code: EJB with Composite Primary Key in ODBMS Indiana
- User Code: EJB with Composite Primary Key in ODBMS Iowa
- User Code: EJB with Composite Primary Key in ODBMS Kansas
- User Code: EJB with Composite Primary Key in ODBMS Kentucky
- User Code: EJB with Composite Primary Key in ODBMS Louisiana
- User Code: EJB with Composite Primary Key in ODBMS Maine
- User Code: EJB with Composite Primary Key in ODBMS Maryland
- User Code: EJB with Composite Primary Key in ODBMS Massachusetts
- User Code: EJB with Composite Primary Key in ODBMS Michigan
- User Code: EJB with Composite Primary Key in ODBMS Minnesota
- User Code: EJB with Composite Primary Key in ODBMS Mississippi
- User Code: EJB with Composite Primary Key in ODBMS Missouri
- User Code: EJB with Composite Primary Key in ODBMS Montana
- User Code: EJB with Composite Primary Key in ODBMS Nebraska
- User Code: EJB with Composite Primary Key in ODBMS Nevada
- User Code: EJB with Composite Primary Key in ODBMS New Hampshire
- User Code: EJB with Composite Primary Key in ODBMS New Jersey
- User Code: EJB with Composite Primary Key in ODBMS New Mexico
- User Code: EJB with Composite Primary Key in ODBMS New York
- User Code: EJB with Composite Primary Key in ODBMS North Carolina
- User Code: EJB with Composite Primary Key in ODBMS North Dakota
- User Code: EJB with Composite Primary Key in ODBMS Ohio
- User Code: EJB with Composite Primary Key in ODBMS Oklahoma
- User Code: EJB with Composite Primary Key in ODBMS Oregon
- User Code: EJB with Composite Primary Key in ODBMS Pennsylvania
- User Code: EJB with Composite Primary Key in ODBMS Rhode Island
- User Code: EJB with Composite Primary Key in ODBMS South Carolina
- User Code: EJB with Composite Primary Key in ODBMS South Dakota
- User Code: EJB with Composite Primary Key in ODBMS Tennessee
- User Code: EJB with Composite Primary Key in ODBMS Texas
- User Code: EJB with Composite Primary Key in ODBMS Utah
- User Code: EJB with Composite Primary Key in ODBMS Vermont
- User Code: EJB with Composite Primary Key in ODBMS Virginia
- User Code: EJB with Composite Primary Key in ODBMS Washington
- User Code: EJB with Composite Primary Key in ODBMS West Virginia
- User Code: EJB with Composite Primary Key in ODBMS Wisconsin
- User Code: EJB with Composite Primary Key in ODBMS Wyoming
Related Articles
- An Overview of Java Database Connectivity
We examine the basic steps required to handle JDBC using javax.swing for creating user interfaces. If you're new to object-oriented programming to databases in Java, this will set you off on the right path.
- Exploring the Oslo Repository
- Using More Advanced JDBC Features
- Practical Uses for DTS
- The Elements of a Database
- Building Microsoft Oslo Models
- Replication and Microsoft SQL Server 2000

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML