Is it possible to have Entity Bean with no primary key class, because I have a table with no primary key and this is used by many tables.
Is it better to have a helper class??...
Please throw some light on this..
--Bob
-
Enity Bean with No Primary Key class(BMP) (2 messages)
- Posted by: Arun Ravi
- Posted on: July 06 2002 07:28 EDT
Threaded Messages (2)
- Enity Bean with No Primary Key class(BMP) by tim fox on July 06 2002 19:03 EDT
- Enity Bean with No Primary Key class(BMP) by Phillip Trewhella on July 08 2002 11:25 EDT
-
Enity Bean with No Primary Key class(BMP)[ Go to top ]
- Posted by: tim fox
- Posted on: July 06 2002 19:03 EDT
- in response to Arun Ravi
All entity beans need to be able to be uniquely identified so they need a unique identifier (primary key).
If your database table contains duplicate rows, ie there is no primary key in the table - it's not possible to uniquely identify a row.
In this case I would say entity beans are not the correct choice for what you're trying to do.
Perhaps use raw JDBC instead. -
Enity Bean with No Primary Key class(BMP)[ Go to top ]
- Posted by: Phillip Trewhella
- Posted on: July 08 2002 11:25 EDT
- in response to Arun Ravi
Hmmm....
A "proper" relational table has no duplicate rows, therefore the set of all columns in the table should uniquely identify a single row (thus a single bean). If you have duplicate entries in the table then perhaps you need to re-evaluate your data model.