• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

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...
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic