• 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

question about ejbSelect

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<query>
<result-type-mapping> Local/Remote </result-type-mapping>
</query>
 
Jingyi Wang
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys very much
 
permaculture is giving a gift to your future self. After reading this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic