Why CMR when we can use FK


EJB programming & troubleshooting: Why CMR when we can use FK

  1. Why CMR when we can use FK (2 messages)

    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.

    Threaded Messages (2)

  2. Why CMR when we can use CMP[ Go to top ]

    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

  3. Waste of resources ??!!![ Go to top ]

    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?