How to remove DEFAULT keyword for IDENTITY column from auto generated insert script in DB2 database?
Issue
-
We're using a
DB2 LINUX (10.5 FP5)DB federation server and created nicknames that are in fact Synonyms toMS SQL 2012Tables. All this is working correctly (SELECT, INSERT, UPDATE, DELETE, etc.). -
In Java applications, developers are using
DB2Dialect. -
The problem we have is related to the INSERT statements currently generated by Hibernate.
-
Is it possible to remove an
IDENTITY COLUMNofdefaultkeyword from the INSERT statements ? -
The SQL statement generated by Hibernate is :
2015-04-13 13:30:48,015 INFO [STDOUT] Hibernate: insert into MY_TABLE (ID, FIELD_ONE, FIELD_TWO) values (default, ?, ?)
2015-04-13 13:30:48,040 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: -30090, SQLState: 25000
- This kind of statement will work with
DB2Table but not with aDB2Nickname pointing to aMS SQLTable.
Environment
- Red Hat JBoss Enterprise Application Platform 6
- Hibernate 4
- IBM DB2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.