• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Problem with CMR CMP Entity Bean

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BackGround
I am new to EJB. I am trying to implement CMR using J2EE RI.

I have a Movie Local Entiry Bean and Director Local Entity Bean (both are CMP). Access to these local Bean is provided using AccessMovie stateless Session Bean.

Relationship between Movie and Director is many ne.

I have specified the relationship between these two beans using relationship TAB in J2EE RI.

For Movie bean i am setting setDirector() CMR in ejbPostCreate() method and i am able to access getDirector().

Problem
For Director CMR 'Collection getMovies()' and 'setMovies(Collection movies)', I am not able to set the values hence nor able to get the values.

Present Approach
1. define a ejbSelect method in movie bean which will return all movies which have a given director id. EJB-SQL is select object(m) from Movie m where m.director.id = ?1

2. define another method in director bean which uses InitialContext and then find the movies by director id and then call setMovies accordingly.

I am not sure very much comfortable with the last step and also getting ServerException.

Can anyone help me with the troubleshooting.

Details
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys for not replying, that forced me to start thinking from the ground and I finally managed to figure this one out.... althought it almost spoiled my dinner...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic