Friends,
In EJB1.1 specification,Sun ask us to maintain the Primary key field name in Deployment Descriptor instead of writing Primary key class.
Is it applicable for Container Managed Persistence only?
Dont I use it for Bean Managed Persistence?
Thanks
Robot Selva
-
Primary key field in DeployementDescriptor (3 messages)
- Posted by: Majic Robot
- Posted on: November 16 2000 14:17 EST
Threaded Messages (3)
- Primary key field in DeployementDescriptor by Kumar Maha on November 17 2000 00:00 EST
- Primary key field in DeployementDescriptor by Majic Robot on November 17 2000 15:38 EST
- Primary key field in DeployementDescriptor by Sanjay Rathod on November 23 2000 12:58 EST
- Primary key field in DeployementDescriptor by Majic Robot on November 17 2000 15:38 EST
-
Primary key field in DeployementDescriptor[ Go to top ]
- Posted by: Kumar Maha
- Posted on: November 17 2000 00:00 EST
- in response to Majic Robot
This actually depends on how u implement the primary key class. If its a wrapper type (Integer, String etc) u need to provide two things. ie <prim-key-class> and <primkey-field>
in ur deployment descriptor for container managed persistence.
If u implement a serialized class for the primary key, u have to mention only the
<prim-key-class>. Here, the class fields has to have a one-one correspondence with that of the bean class fields.
For Bean managed persistence u dont write anything in the deployment descriptor. Everything is managed in the code.
Regards
Kumar -
Primary key field in DeployementDescriptor[ Go to top ]
- Posted by: Majic Robot
- Posted on: November 17 2000 15:38 EST
- in response to Kumar Maha
Thanks for your response.
This is what I expected..
When I write Bean Managed persistence bean,Can I use <prim-key-class> and <primkey-field> in the Deployement descriptor instead of writing a primary key class..
For example
This entity bean is bean managed persistence.
Home Interface name : CusHome
Remote Interface name : CusRemote
Bean name : Customer
In deployment descriptor,I mention primary key class like this
<prim-key-class>java.lang.String</prim-key-class>
<primkey-field> custId </primkey-field>
Is it possible?
Thanks
Robot selva -
Primary key field in DeployementDescriptor[ Go to top ]
- Posted by: Sanjay Rathod
- Posted on: November 23 2000 00:58 EST
- in response to Majic Robot
Hi Majic Robot,
As per EJB 1.1 specs in CMP you can it is optional to specify list of container-managed fields and specification of the primary key field also
The optional primkey-field may be present in the descriptor if the entity’s persistency-type is Container. So you need not have to specify <primkey-field> custId </primkey-field> in ejb-jar.xml file.
But at least one cmp-field element must be present in the descriptor if the entity’s persistency-type is Container, and none must not be present if the entity’s persistence-type is Bean.
Cheers!!!
Sanjay_Rathod@hotmail.com