From: | "Arun" <arun(dot)viswanathanchandrika(at)ust-global(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #3920: sequence not generated for postgres using toplink jpa |
Date: | 2008-02-01 14:52:26 |
Message-ID: | 200802011452.m11EqQmB086024@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 3920
Logged by: Arun
Email address: arun(dot)viswanathanchandrika(at)ust-global(dot)com
PostgreSQL version: 8.2
Operating system: Win XP
Description: sequence not generated for postgres using toplink jpa
Details:
sequence not generated for postgres using toplink jpa
This sequence generator code is not working properly
@SequenceGenerator(name="catalog_seq_gen", sequenceName="catalog_seq",
allocationSize=1)
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE,generator =
"catalog_seq_gen")
@Column(name ="catalog_id", nullable = false)
private Long catalogId;
@Column(name = "CATALOG_NAME", nullable = false)
private String catalogName;
@Column(name = "CATALOG_DESC")
private String catalogDesc;
I have 3 fields in the code and toplink is generating the query wrongly
Exception in thread "main" javax.persistence.PersistenceException:
javax.persistence.PersistenceException: Exception [TOPLINK-4002] (Oracle
TopLink Essentials - 2.0 (Build SNAPSHOT (06/04/2007))):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: null value in
column "catalog_id" violates not-null constraint
Error Code: 0
Call: INSERT INTO CATALOG (CATALOG_NAME, CATALOG_DESC) VALUES (?, ?)
bind => [Description, null]
ideally it should generate
INSERT INTO CATALOG (CATALOG_ID, CATALOG_NAME, CATALOG_DESC) VALUES (?,?,
?)
bind => [1, Description, null]
I am using Oracle TopLink 11g: Technical Preview 3
what could be the reason?
From | Date | Subject | |
---|---|---|---|
Next Message | Adam Hardy | 2008-02-01 15:38:36 | Re: BUG #3894: JDBC DatabaseMetaData.getTables is inconsistently case-sensitive with schema name |
Previous Message | Sergey | 2008-02-01 09:55:08 | BUG #3919: Service Privileges Bug |