Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is an EJB primary key? How is it implemented when the database doesn have a primary key?

0
Posted

What is an EJB primary key? How is it implemented when the database doesn have a primary key?

0

A primary key is an object that uniquely identifies the entity bean. According to the specification, the primary key must be unique for each entity bean within a container. Hence the bean’s primary key usually maps to the PK in the database (provided its persisted to a database). You may need to create a primary key in the database for the sake of referential integrity. This does not, however, mean you NEED a primary key in the database. As long as the bean’s primary key (which maps to a column or set of columns) can uniquely identify the bean it should work.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.