I am getting an error while generating a sequence for an id field in HSQLDB. The mapping file is configurated like this:
<hibernate-mapping>
<class name="ddol.rtdb.dto.Configuration" table="RTDB_CONFIGURATION">
<id name="id" type="int">
<column name="CONF_ID" />
<generator class="sequence">
<param name="sequence">CONF_ID_SEQ</param>
</generator>
</id>
<property generated="never" lazy="false" name="configurationDate"
type="java.util.Date">
<column name="CONF_DATE" />
</property>
It works when I use the same mapping with oracle, but does not generate the sequence when used with HSQLDB for testing. Is there anything else I should add to the mapping?
The error I am getting when I try to insert something into the table is:
ERROR org.hibernate.util.JDBCExceptionReporter - user has no privileges or object not found: CONF_ID_SEQ
HSQLDB version is 2.2.8, Hibernate version is 3.6.10
Create the sequence(CONF_ID_SEQ – if it doesn’t exists) and make sure that you have
"grant"permission for that.Alternatively, you can create a
"synonym"for the sequence and give"grant"permission for all the users or to the specific users you want to. Then it should work.