Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic