File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes HSQL DB with JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HSQL DB with JPA" Watch "HSQL DB with JPA" New topic


karibasappa Guttur Chikkaveerappa

Joined: Jan 26, 2013
Posts: 11
Hi All,

I have one reqt in my project.

We are using in memory HSQL DB. for non primary column i want to generate a sequence , if anyone knows please reply me soon.

I treied the following ways but seq generated was always zero for all records.

1) @GeneratedValue(strategy=GenerationType.SEQUENCE,generator = "myGen")
@SequenceGenerator(name = "myGen", initialValue=1,allocationSize=100)

2) @Column(name = "JOB_ID")
private long jobId;
Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 466

Did you google on the issue? Check this one.

Vinod Tiwari | Twitter | Shikshanirman | Guftgu
I agree. Here's the link:
subject: HSQL DB with JPA
It's not a secret anymore!