IntelliJ Java IDE
The moose likes EJB and Other Java EE Technologies and the fly likes Is there a way to write finder method by join of two table in websphere 4.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "Is there a way to write finder method by join of two table in websphere 4.0" Watch "Is there a way to write finder method by join of two table in websphere 4.0" New topic
Author

Is there a way to write finder method by join of two table in websphere 4.0

Samir Bhagwat
Greenhorn

Joined: Nov 08, 2001
Posts: 11
Hello all,
I need to have a finder method which will bring the result by joining of two tables.
Eg select T1.*, T2.* from Order T1 Customer T2 where T1.id = T2.id
Is there a facility to write such a finder in websphere 4.0?
Thanks & Have a nice day,
Samir
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
Not in Container Managed Persistence, there isn't. In Bean Managed Persistence, of course you can write any SQL you like in your ejbFind... methods.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Samir Bhagwat
Greenhorn

Joined: Nov 08, 2001
Posts: 11
Thanks Kyle, your suggestions are really valuable.
Samir Bhagwat
Greenhorn

Joined: Nov 08, 2001
Posts: 11
Hi Kyle,
One last question about finder methods to you. We were using powertier application server and we are planning to shift to websphere 4.0.
In powertier one writes custom finder method in home interface and one implements that in Bean class. I don't see this in websphere 4.0 here one has to use finder helper classes for it. But we have currently implemented custom finder method which takes custom object as inputs and it returns Enumeration of Custom objects which are not EJBObject.
For e.g. Consider custom finder method declared in home interface as follows:
Enumeration findByFilter(FilterObject f).
Now this enumeration contains Objects of class Table which is not EJBObject.
First I don't see this type of implementation in websphere. Am I right? So to accomplish this feature I have to create another layer before calling Entity bean which will do this functionality. Am I right or webshepere will provide this funciotnality?
Thanks a lot,
Samir
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
You are right, WebSphere will not provide that functionality (finders that don't return the type of the remote interface). That is not in compliance with the EJB spec. So yes, you'll have to write another layer of software to be in compliance with the spec and make it work in WebSphere.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
 
subject: Is there a way to write finder method by join of two table in websphere 4.0
 
Threads others viewed
Deadlocks in Threads?
adding "org.omg.stub" to my classpath
Really need to synch Create ?
Thread communication
throwing exception from a thread
jQuery in Action, 2nd edition