File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubts  on EJB-QL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubts  on EJB-QL" Watch "Doubts  on EJB-QL" New topic
Author

Doubts on EJB-QL

Pradeep Dhavakumar
Greenhorn

Joined: Feb 05, 2004
Posts: 19
I got some basic doubts . Kindly help.

*Under what element in the DD do you place the EJB-QL statement?
*And how do you use them in an entity bean method?
*Can you direcly run an EJB-QL statement from a bean method without using the DD?How ?
* "CMR field is ALWAYS another entity bean's 'local' interface" - What if I have only 'remote' interfaces ? How do I relate beans then ?

Thanks,
Pradeep.D


SCJP1.4,SCWCD1.3,SCBCD1.3.
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
*Under what element in the DD do you place the EJB-QL statement?

<query>
...
<ejb-ql>your ejb ql goes here</ejb-ql>
</query>
*And how do you use them in an entity bean method?

ejb ql are for finder and select methods, so you define the finder/select methods in the home intf/bean class first and add the ejb ql in the DD.
*Can you direcly run an EJB-QL statement from a bean method without using the DD?How ?

EJB-QL are instructions for the container to generate actual SQL (or other db specific queries) FOR THE finder/select methods you defined. You CANNOT execute EJB-QL directly.
* "CMR field is ALWAYS another entity bean's 'local' interface" - What if I have only 'remote' interfaces ? How do I relate beans then ?


No, you cannot use remote interfaces with CMR. If you really need remote interface for the ebean, you have to define both local and remote interfaces. You can define both at the same time.

Hope these help.
Pradeep Dhavakumar
Greenhorn

Joined: Feb 05, 2004
Posts: 19
Thanks Alec..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubts on EJB-QL
 
Similar Threads
EJBQL access EntityBean defined in another .jar
newbie:select method problem
primary key class of entity beans?
ejbSelect
Anatomy of Deployment Descriptor