users@glassfish.java.net

TOPLINK-41 for SQL Server 2005

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 Feb 2008 14:22:34 PST

I have mapped several entities to a SQL Server 2005 database. I am using the Identity column as a sequence generator for the primary key in each table.

This is how I do it:

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="server_asset_id", unique=true, nullable=false, precision=18, scale=0)
    public Long getServerAssetId() {
        return this.serverAssetId;
    }


However, I am getting the below error:
Exception [TOPLINK-41] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: A non-read-only mapping must be defined for the sequence number field.
Descriptor: RelationalDescriptor(jtdi.cm.ejb.bean.entity.ServerAsset --> [DatabaseTable(jtdi_cm_db.dbo.server_asset)])


When I go look at the table properties in SQL Server 2005, I see the identity is setup properly.

Am I doing this wrong? Any suggestions would be greatly appreciated. Thank you for taking the time to read my post.

Russ
[Message sent by forum member 'russ205' (russ205)]

http://forums.java.net/jive/thread.jspa?messageID=260040