• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
https://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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can some experts help me ?

thx ~
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also a little confused about this. Can some one please respond to this.
 
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
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
reply
    Bookmark Topic Watch Topic
  • New Topic