"Fillon, J�r�me" wrote:
> Hi all,
>
> I used to create EJB eb with a Bean Managed Persistence.
> Usally i`m creating an EJB eb for each table of mt database model.
> Is it a good thing ?
> How do you do it in general ? even if you are using CMP ?
If you use BMP, the mapping between beans and database tables is up to you.
You can of course create one bean per table. This will work. However, it might not be
the best mapping.
The idea behind EJBs is that they should represent a component.
In general, one starts with a conception of the application to identify classes, i.e.
beans, and relationships, which can be represented either as separate relationship
classes, or references between beans.
Later, classes and relationships are mapped to a physical representation.
Because of the limitations of the relational model, one class may lead to several
tables.
For example, a multi-valued attribute has to be stored in a separate table using
foreign keys.
The current CMP implementation of JOnAS creates one table per bean, and is limited
w.r.t. the type of CMP attributes.
We at France Telecom R&D are working on JORM, which will provide an improved CMP
implementation. This will allow multi-valued attributes to be automatically mapped to
a separate table. It will also allow inheritance between CMP beans and references
between CMP beans.
The first implementation of the JORM mapping will be an implicit object to relational
mapping.
In the long term, we intend to propose a more flexible object-relational mapping,
where the user will be able to specify the mapping onto legacy tables.
alex
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".