| Author |
HSQL db for JPA: auto incremented for a regular column
|
H Paul
Ranch Hand
Joined: Jul 26, 2011
Posts: 299
|
|
This is just a regular column that I want to have it auto incremented
After loading data, the NUMBER is always zero.
Am I missing something or doing something wrong or is HSQL db sql syntax incorrect?
|
 |
James Sutherland
Ranch Hand
Joined: Oct 01, 2007
Posts: 550
|
|
Try adding,
@GeneratedValue(IDENTITY)
See,
http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Sequencing
|
TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
|
 |
H Paul
Ranch Hand
Joined: Jul 26, 2011
Posts: 299
|
|
0. Thanks, James.
1. From
HyperSQL User Guide
HyperSQL Database Engine (HSQLDB) 2.2
2. Below is OK. Nothing unusual.
3. What I want is NOT an ID, rather a regular colum with auto-incremented.
This is OK by point 1. That's if we create using DDL itself.
But below is not OK. Could there be something else?
|
 |
 |
|
|
subject: HSQL db for JPA: auto incremented for a regular column
|
|
|