Can any body specify the location for examples which does use compount primary key in cmp entity bean.
- Posted by: suresh t
- Posted on: August 20 2000 19:09 EDT
- Can any one know Compound primary entity bean using weblogic by Suresh Vasudev on August 21 2000 07:51 EDT
- Can any one know Compound primary entity bean using weblogic by Pankaj Vij on September 05 2000 14:38 EDT
You can use compound primary key in Bean Managed Entity beans. for that you have to define these fields in the Primary key class.
The create method in Home interface must be modified in such a way that it takes all the Primary key field values as parameters. els you have to provide a create method which takes a Primary Key class as the Input.
For example if CustomerId and DepartmentId is the Primary key of that class then you have to define these two fields in the Primary Field class.
There ca=n be two versions of the crfeate method as
create(long customerid, long departmentid) or
create (BeanPk pk) , where BeanPK is the Primary class for that Container Managed Bean.
Hope I have answered your querty. If not satified sens a mail to [email protected]
U can use compound primary keys in CMPs too...its only that during the deployment u need to specify the primary key in the XML file in a different manner.
Compound keys are defined in ejb-jar.xml file by specifying only the user defined class.
I hope this solves ur problem