• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to return CMR object / Collection in EJB-QL ?

 
Vince Hon
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has been discussed before, but I didn't find a conclusion about this. one of the thread I read:
http://www.coderanch.com/t/159465/java-EJB-SCBCD/certification/HFEJB-Why-EJBQL-SELECT-Cant

HFB P406, in the box it says: You can't use dot notation to return a CMR field e.g.


Director : Movie == 1 : Many

SELECT m.director FROM MovieSchema m
is invalid if 'director' is CMR field.


I got 2 Questions:

1.
If it is invalid, how can I return the component interface of the CMR field (director).
Is it "SELECT OBJECT(m.director) FROM MovieSchema m ?


2.
if I change the relationship to "Director : Movie == Many : Many"

How can I return a collection (component interface) of directors belong to one movie ?
Is it "SELECT OBJECT(m.directors) FROM MovieSchema m ?
or
"SELECT ds FROM MovieSchema m, IN (m.directors) ds ?

Thanks !!
 
Vince Hon
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some experts help me ?

thx ~
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also a little confused about this. Can some one please respond to this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic