Meaningless Drivel is fun!
The moose likes EJB and other Java EE Technologies and the fly likes CMR, and EJB QL question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "CMR, and EJB QL question" Watch "CMR, and EJB QL question" New topic

CMR, and EJB QL question

John Marchesino

Joined: Oct 04, 2007
Posts: 2

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.

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.

I agree. Here's the link:
subject: CMR, and EJB QL question
It's not a secret anymore!