EJB design: Innumerable findByXxx-methods?
I have got an existing EJB (2.0) application, which contains a number of cmp entity beans, that are related to each other.
- Posted by: Johannes Lietz
- Posted on: September 10 2002 20:54 EDT
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...
I would do this in a sessionbean.
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.
Thanks for the hint, interesting!
I found this one from bea:
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)