• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How container puts up primary key in deployement descriptor file in CMP?

 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have done a CMP program in which I observed that when I stored 3 fields in database from client, container took one of the fields as primary key. How container knows which field has to be taken as primary key (in CMP)?

Thanks and Regards,
Narendranath.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Naren

I think you are not clear with the attribute of ejb-jar.xml.

if you see that closely in the tags of <entity></entity> where you define all your entity beans and the cmp fields you define the primary key class and also the <primkey-field></primkey-field>

This xml file is read by container during your deployment and hence container knows which is your primary key field for the entity bean and hence the for the table.

Best Regards
Pankaj
 
Naren Chivukula
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah! what you said is right and I know that. But in WEBLOGIC you need not even create .xml file manually! If we provide the path for the class files of our CMP program and use build deployment descriptors option, container automatically creates the .xml files. When we try to see ejb-jar.xml file, there the primary key is specified by a field name. I wonder this how it does it selects the primary key from the list of fields we specify in bean class through get and set methods.


Thanks and Regards,
Narendranath.
 
reply
    Bookmark Topic Watch Topic
  • New Topic