views:

170

answers:

1

Hello, I need to use a sequence to get a unique value. The production code uses postgres but I would like to access it via Hibernate so that I can test this with HSQLDB.

How can I create and read a sequence in Hibernate?

+1  A: 

You could try to reuse the code from HibernateDialect but the main API doesn't offer this. Your best bet is probably to wrap this in an interface and then use different implementations depending on your dialect.

Aaron Digulla