Re: is it necessary to have one entity bean for one table in the database?
Posted By:
Madani_Benghia
Posted On:
Sunday, April 8, 2001 01:49 AM
Yes ,you can have one entity bean for multiple tables.However,I do not think you can map one variable in your CMP EJB to two (or more) fields from different tables because one entity bean represent a row of data in a table.
Re: is it necessary to have one entity bean for one table in the database?
Posted By:
AlessandroA_Garbagnati
Posted On:
Friday, April 6, 2001 08:22 AM
Srinivas,
Yes, you can associate multiple table in a database with a single entity bean, but you will not be able to use the CMP (Container-Managed Persistence), but you will need to use BMP (Bean-Managed Persistence): you have to handle the entire lifecycle of your bean.
In the new specs (EJB 2.0) that are not yet formalized officially, the CMP will be able to manage relationships between table, helping, probably, cases like yours.