Title: RE: Primary key in an EJB

Table doesn't have to have a primary, but there should be column that uniques defines each row different. This usually is a primary key, but any index column should work... For these primary keys or index columns, you should create a proper primary key for it.

Se Hee

-----Original Message-----
From: Seung Bang [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 08, 2000 6:22 PM
To: Orion-Interest
Subject: Primary key in an EJB


Hi,
How should I specify a primary key in an Entity bean, for which a db
table
really does not have a primary key?  To my understanding, a database
table with
a primary key can be represented with Entity beans as follows:
  ejbActivate():
       primKey = ctx.getPrimaryKey();

  ejbPassivate():
       primKey = null;

With that scheme, pooled beans can be reactivated with that primary key
later on.
What if a table does not have a primary key? How can it be reactivated
with what
primary key and how is it distinguished from other pooled beans? How
about
ejb-jar.xml descriptor? What do I put in the primary key field?
Thank you very much.

Seung,



Reply via email to