hi
what i want to do is i have a table dod in which i have primary key and one more table cnmas which has foreign key when i want to insert the data in dod table then that inserted data will be match in the foreign key if that value exist in the cnmas(foreign key table) then the value will be inserted other wise it will return back so this is my problem for that what i did is:-

i make two beans cnmas and dod for both foreign and for primary key for both
cnmas
dodAuthorisation
in dod module from where i want to insert the data which has the primary key
and the primary key of this table will match with the foreign key of cnmas table.

when i make bean class then i define my primary key which map with the cnams foreign key is like:-
public String ejbCreate(CnmasLocal cnmas_cnmtNo, more double,string,Date values in it)
{
public abstract CnmasLocal getCnmas_cnmtNo();
public abstract void setCnmas_cnmtNo(CnmasLocal cnmas_cnmtNo);
}
here more getter and setter methods for string date and double fields
same i have local interfaces and remote interfaces fine

now this is my client code to call the beans:-
CnmasHome cnhome = (CnmasHome)PortableRemoteObject.narrow(ctx.lookup("Cnmas"), CnmasHome.class);

DodAuthorisationHome dodAuthHome = (DodAuthorisationHome)PortableRemoteObject.narrow(ctx.lookup("DodAuthorisation"), DodAuthorisationHome.class);

DodAuthorisation dodAuthorisation;

Cnmas cnn = cnhome.findByPrimaryKey(dpwb_no);

dodAuthorisation=dodAuthHome.create(dpa_name,dpb_name,dpi_no,dpi_date,dpi_value,dprb_days, dpdb_name,dppo_no,dppo_date,dpcr_no,dpsr_no,cnn,dpa_date,dpa_amount,dformc,dpd_amount,dpc_amount,dpd_favourof,dpc_favourof,dpd_payableat,d pc_payableat,dcancel,username,sqlToday,emodify_by,emodify_date);


now my problem is
in the client code i have look up both the beans but in return to that it will give me the refrence of the home interface where i can use to find the primary key through finder method and it will call the findByPrimaryKey() in the home interface .
but the client will only interact with the local bean
as we use this value in the parameter of the create method which is of local type as shown bold
but the main problem is
i use the refrence of findByPrimaryKey() in the create method as parameter but the finder method will return the Cnmas and the parameter type will be CnmasLocal because of this it creates error
now tell me how to solve it
thanks alot