Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with CMR CMP Entity Bean  RSS feed

 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!