After reading documentation and all, I understood that the method to use the Oracle sequence generator for generation of id's is:
<id name="id" column="ID" type="java.lang.Long" unsaved-value="null">
<generator class="sequence">
<param name="sequence">PFX_APP_MC_CORRESPONDENCE_SEQ</param>
</generator>
</id>
I am using oracle 9i and the sequence PFX_APP_MC_CORRESPONDENCE_SEQ exists. Even so, hibernate fails to find the correct sequence name, and gives the following error:
...
Hibernate: select hibernate_sequence.nextval from dual
15-aug-2005 12:41:01 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 2289, SQLState: 42000
15-aug-2005 12:41:01 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-02289: sequence does not exist
...
For some reason, Hibernate insists on using the default sequence name hibernate_sequence.
Anyone knows what might be wrong?
|