I am sure I am missing some fundamentals here.....
I see lot of places that says CMR is the best way of doin database relation ships in CMP.....and much more about it.
My concerns:-
For a CMR, when ever I add a row in a data base, by invoking ebjCreate(), the very next thing I got to do is to add this created local reference to a collection in its related bean (talking bt one to many or many to many).
I even read in some tutorials of some XYZ app servers that, These realtionships are maintained as a seperate table in data base.( which to me is wastage of resources).
The next confusion in my mind is; what does CMR fetches which Foreign Key does;nt. Why not use Foreign Key concept and write some good EJB-QL in finder and selectors.
Clear my confusions,I guess miss understandings.
TIA
Moin.
-
Why CMR when we can use FK (2 messages)
- Posted by: Sugra Moin
- Posted on: December 23 2003 12:07 EST
Threaded Messages (2)
- Why CMR when we can use CMP by samy mohan on December 24 2003 03:59 EST
- Waste of resources ??!!! by Ferhat SAVCI on December 26 2003 02:54 EST
-
Why CMR when we can use CMP[ Go to top ]
- Posted by: samy mohan
- Posted on: December 24 2003 03:59 EST
- in response to Sugra Moin
Hi,
What is the advantage of using CMR rather than going as CMP, because we have the relationship defined in DB.I have made ejbs with CMP without any CMR fields(i made the relationship column as CMP field) it works fine for me.I don't know when it will make problem.Is there any advantage in CMR field.Can anyone help me in this regard
Thanks in advance
Samy -
Waste of resources ??!!![ Go to top ]
- Posted by: Ferhat SAVCI
- Posted on: December 26 2003 02:54 EST
- in response to Sugra Moin
I thought one of the advantages of normalizing your schema was avoiding redundancy (== waste of resources). And, furthermore, how do you propose to handle M:N relations?