Can any body specify the location for examples which does use compount primary key in cmp entity bean.
Discussions
EJB programming & troubleshooting: Can any one know Compound primary entity bean using weblogic
-
Can any one know Compound primary entity bean using weblogic (2 messages)
- Posted by: suresh t
- Posted on: August 20 2000 19:09 EDT
Threaded Messages (2)
- 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
-
Can any one know Compound primary entity bean using weblogic[ Go to top ]
- Posted by: Suresh Vasudev
- Posted on: August 21 2000 07:51 EDT
- in response to suresh t
Hi
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] -
Can any one know Compound primary entity bean using weblogic[ Go to top ]
- Posted by: Pankaj Vij
- Posted on: September 05 2000 14:38 EDT
- in response to Suresh Vasudev
Hi
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.
Example :
<entity>
<prim-key-class>
com.something.SomePK
</prim-key-class>
</entity>
I hope this solves ur problem
Pankaj