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 question about ejbSelect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "question about ejbSelect" Watch "question about ejbSelect" New topic
Author

question about ejbSelect

Jingyi Wang
Greenhorn

Joined: Jul 30, 2003
Posts: 25
If I want to write a ejbSelectByName other than findByName, then the EJB-QL would be:
SELECT OBJECT(m) FROM MovieSchema m WHERE m.name=?1
Then my question is how does the container figure out which component interface ( local or remote ) to be returned.
For findByName, (I guess) the container can figure it out by looking at which interface the findByName method is defined. For example, if findByName is defined in local interface, then a local interface will be returned. But there is no local or remote bussiness invovled in ejbSelect method, so how does the containter know which component should be returned.
Or we should never use this kind of sql in ejbSelect method.

Anybody can explain in P408 "As if by magic, the Container knows which interface view to return, local or remote, depending on whether the invocation of the query came from a home or Remote interface", why "home" or "Remote" interface?

Thanks
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
When you create a "select", there are elements in your deployment descriptors where you do stuff, like actually saying what the EJB-QL is. There are some nodes to say which component interface will be returned (remote, local). Check out the DTD for more info.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
<query>
<result-type-mapping> Local/Remote </result-type-mapping>
</query>


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
Jingyi Wang
Greenhorn

Joined: Jul 30, 2003
Posts: 25
Thank you guys very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question about ejbSelect