persistence@glassfish.java.net

RE: Implementation Strategy

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Thu, 26 Oct 2006 11:08:20 -0400

Hello Stephen,
   Yes you would still need the @GeneratedValue annotation and would use the IDENTITY strategy (@GeneratedValue(strategy=IDENTITY)). There would be no need to remove the contactID references from you application. I am not aware of the article that you are referring to but Sun App Server with TopLink as the Persistence Provider does support PK generation in this form. JSF can leverage JPA as well. Examples can be found at http://www.oracle.com/technology/products/ias/toplink/jpa/examples-index.html
--Gordon

-----Original Message-----
From: Stephen Carpenter [mailto:stephen-hic_at_hotmail.co.uk]
Sent: Wednesday, October 25, 2006 7:21 AM
To: gordon.yorke_at_oracle.com
Subject: Implementation Strategy


Hello Gordon,

Thanks for replying to my earlier mail.

I am looking for identity field PK generation. My db table has the following
construction for the contact_id field, (Derby db),

contact_id INT NOT NULL GENERATED ALWAYS AS IDENTITY
        ( START WITH 1, INCREMENT BY 1),

Would I still use the GeneratedValue annotation and what implications are
there for the JSF pages? Would I need to remove the contactid references in
NEW.jsp for instance.

I am developing in NetBeans5.5 with the Sun App Server.
I am also confused about the use of App Server with db generated primary
keys as I have just read a Netbeans article which implies that Sun App
Server does not support db generated primary keys in this way ??? It steers
you towards EJB modules, sesssion and facade beans etc.
Am I going to achieve inserts to db generated primary keys via JSF?

Thanks again for your time,

Regards,

Stephen.

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free!
http://imagine-msn.com/messenger/launch80/?locale=en-gb