• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

CMR, and EJB QL question

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am having some problems while using cmr mapping along with a ejb ql join.

Here is my situation.

I have a table that maps to many other tables through cmr mapping. In other words I have a parent table or Entity Bean with many child tables or child Entity beans.

The parent table is named OutageRequest

When I do a straight forward FindBYPrimaryKey I get the the OutageRequest Entity Bean back and I am able to access all of its children throught the relevent getter methods

When I run a ejb query that joins a child table with the OutageRequest(parent) table to filter my query results I run into my problem. I get the OutageRequest EJB back but I am unable to access any of its child Entity Beans. In other words I can get data back form the rows returned in the OutageRequest table but I cannot access the data form any of its child tables. Here is an example of the query I am using.

<![CDATA[SELECT DISTINCT OBJECT(a) FROM OutageRequestEJB AS a
WHERE a.outageDates.startDateTime BETWEEN ?1 AND ?2]]>

OutageRequestEJB is the parent bean. outageDates is one of its many child elements. OutageRequestEJB and outage dates have a one to many bi-directional relationship.


I have been struggling with this problem for days. Any insight would greatly appreciated.

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic