2 Replies Latest reply on Oct 26, 2002 6:30 AM by Jürgen Krannich

    How to prevent writting primary key

    Sascha Newbie

      Hi,

      I'm new to EJB and so I've some problems.
      I'm using JBoss 3.0.0 with MS SQL Server 2000 and JBuiler 6 EE. To write data to database I'm using CMP. Now I have a table which uses an IDENTITY (autogenerated primary key) field as Primary Key. Is it possible to prevent the CMP to write the Primary Key? My CMP always generates an INSERT statement which includes the Primary Key field. Given that I don't set the Primary Key in the CMP, the CMP always writes NULL into the table. This results in an error. Can anybody help me?