Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB HELP

 
vikassheel gupta
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i want to ask u in the 1:1 relation mapping in cmr ejb i am going to use remote interfaces home interfaces and i have use local home and remote interfaces but
i cant understand when the client call the findByPrimaryKey method of another bean who has foreign key that methods return type will be of local remote interface or remote interface.
bcz my error will be of:-

incompatible types; found: model.cnmas.Cnmas, required: model.cnmas.CnmasLocal

so if i put local interface then it will call the home interface create method where the datatype is of local type
so it will create a problem for me
so any one tell me how to use local interface finder method .
thanks alot
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you implement the 1:1 relationship with BMP or CMP entity beans?
 
vikassheel gupta
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i am implementing 1:1 relationship in cmp ejb with jdeveloper as IDE

tell me how to solve this problem related to primay key
or should i use the iterator like this:-

iterator i=home.findByPrimaryKey("").iterator();
while(i.hasNext())
{
Cnmas cnn=(Cnmas)PortableRemoteObject.narrow(i.next().cnmas.class);
cnmas.getID();
}

or with out this like

Cnmas cnn = cnhome.findByPrimaryKey(dpwb_no);
but if i use this statement in the client side
then my problem in this case :-

1. i have multiple records in dpwb_no because primary key has multiple records retrival fine

2. second problem is home interface ka finder method call kar raahain hain and whose return type is not local type
but client will interact only through the localhome interface so pls
tell me how to do that

thanks alot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic