-
1. Re: Beginner needs help with modelisation issue
sesques Apr 24, 2004 8:07 AM (in response to balteo)Hi Julien,
My suggested Approach:
1. First of all decide do you require EJB or not?
if yes then..
You have 3 options for data access in j2ee.
1. CMP
2. BMP
3. Pure JDBC calls.
CMP:
CMP entity beans can span only a single database table. With the introduction of the EJB 2.0 standard, you can use CMR fields (Container Managed Relationships). A CMR allows a CMP entity bean to maintain a "relationship" to other CMP beans as long as these relationships are represented in the underlying database as foreign keys. CMR allows also relation tables (such as your establishments_qualifiers table). The CMP approach gives you 3 entity beans (establishments, categories and visitors_comments) with 2 relationships (one with a relation table).
BMP : With BMP, you can have a single entity bean to span your tables. But all the persistence will be managed by you. This is a tiresome, repetitive, and error-prone job, and it often sacrifices portability for the sake of performance.
JDBC calls : Write a session bean with pure JDBC calls allows you also to have a single bean span to your tables. Same opinion as BMP's.
Another solution will be using 3 CMP entity beans (as described above) , and one BMP entity bean which fields are the 3 other beans. In this case, the persistence will be managed by the container and you can use your tables through a single BMP bean.
Good luck -
2. Beginner needs help with modelisation issue
balteo Apr 24, 2004 12:17 PM (in response to balteo)Sesques,
Thanks a lot for your lengthy reply!
Julien. -
3. Re: Beginner needs help with modelisation issue
triathlon98 Apr 25, 2004 6:07 AM (in response to balteo)You could use a framework for this kind of thing.
Using Uni-d, you would define one table for this. The framework will then generate for your three CMP beans and session facade for you.
Problem is that Uni-d currently completey lacks documentation... Will have to work on that.
Joachim