This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Problem with accessing a CMR field, SOS 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 "Problem with accessing a CMR field, SOS" Watch "Problem with accessing a CMR field, SOS" New topic
Author

Problem with accessing a CMR field, SOS

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi all.
I have the following cmp entity beans: TeamBean and PlayerBean
the relationship is 1 : * (one team, many players) bidirectional.
the TeamBean has to CMR field: getPlayers( ) and setPlayers(Collection)
and I have a session bean LeagueBean (session facade) and this bean has
the following method :

but when calling findPlayersWithinTeam method, nothing displayed at all,
and there is no exception.
so I think maybe because getPlayers is CMR field so I can't use it outside.
so I created the following method in TeamBean:

and the EJBQL for ejbSelectPlayers method is :
SELECT OBJECT(P) FROM TeamBean AS T, in (T.players) AS P WHERE T = ?1
and calling findPlayersWithinTeam method, nothing displayed and no exception !!
WHY ???
How can I get the players for a specific team ??
[ April 22, 2004: Message edited by: John Todd ]
 
GeeCON Prague 2014
 
subject: Problem with accessing a CMR field, SOS