Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Automatic Primary Key Generation

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

When I tried using auto-generate to generate my IDs with CMP beans, I got an exception and so I looked for alternatives. I came across this:

In the deployment descriptor, the primary key class must be defined as a java.lang.Object. The primary key field is not specified.
In the home interface, the argument of the findByPrimaryKey method must be a java.lang.Object.
In the entity bean class, the return type of the ejbCreate method must be a java.lang.Object.
In these entity beans, the primary key values are in an internal field that only the EJB container can access. You cannot associate the primary key with a persistent field or any other instance variable. However, you can fetch the bean's primary key by invoking the getPrimaryKey method on the bean reference, and you can locate the bean by invoking its findByPrimaryKey method.

when I try to do that throught the WSAD for DB2, I get a problem which stops the generation of the deployment code..most probably bec. the table id is not mapped to a field in the bean. How can I bypass this problem?
 
reply
    Bookmark Topic Watch Topic
  • New Topic