This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubts on EJB-QL

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

*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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Alec..
 
permaculture is largely about replacing oil with people. And one tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic