Innumerable findByXxx-methods?

Discussions

EJB design: Innumerable findByXxx-methods?

  1. Innumerable findByXxx-methods? (3 messages)

    I have got an existing EJB (2.0) application, which contains a number of cmp entity beans, that are related to each other.

    Now I want to find certain entities from a certain EJB, depending on its relationships to other beans.

    Let's say I want to make a selection on bean A, depending on the existence or non-existence of beans B related to A, or with Bs having certain values, then the same with another Bean C related with A and so on.

    As the EJB-QL select statements for this are hardcoded into the deployment descriptor and cannot be generated dynamically, this leads me to believe I will have to write innumerable find-methods in my home interface, one for each case.

    I don't think I am the first one having this problem, thus, are there any design stategies for this? Should I discard cmp in this case?

    I'm grateful for any hints, as I could not find anything useful about it yet...

    Threaded Messages (3)

  2. Innumerable findByXxx-methods?[ Go to top ]

    I would do this in a sessionbean.
  3. Innumerable findByXxx-methods?[ Go to top ]

    Hi

    This problem can be aimed at if u r using weblogic 7.0
    please look at teh weblogic 7.0 documentation for more deatils
    i treid to get the link but could get figure out now.




    HTH
    sunil.s
  4. Innumerable findByXxx-methods?[ Go to top ]

    Thanks for the hint, interesting!

    I found this one from bea:
    http://e-docs.bea.com/wls/docs70/ejb/cmp.html#1089703

    Unfortunately I will be locked into WL 6.1 for some time, and my app will have to run on different appservers than WebLogic.

    I had a look at the next EJB (2.1) specification, dynamic queries are deferred for some next next release...

    Damn, they are always missing to declare useful things as a standard... (e.g. like ORDERBY in 2.0)

    - Johannes