Trying to get a sequence, I get output:
select hibernate_sequence.nextval from dual
I'm using the syntax that is found in the documentation, but it doesn't seem to be picking up my sequence name.
Thanks,
Steve
--------------------------------------------------
Version: 2.1.2
Mapping Doc:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="Modality">
<class name="com.cti.resource.Modality" table="PRTL_MODALITY">
<id name="id" column="id" type="long">
<generator class="sequence">
<param name="sequence">PRTL_MODALITY_ID_SEQ</param>
</generator>
</id>
<property name="name" />
<property name="description" />
<property name="providerId" column="provider_id"/>
<property name="deletedBy" column="deleted_by"/>
<property name="deletedDate" column="deleted_date"/>
<property name="modifiedBy" column="modified_by"/>
<property name="modifiedDate" column="modified_date"/>
<property name="deleted"/>
</class>
</hibernate-mapping>
Code:
Modality mod = new Modality();
Session hibsession = null;
try {
hibsession = HibernateUtil.currentSession();
}
catch (net.sf.hibernate.LazyInitializationException lie) {
lie.printStackTrace();
}
mod.setDescription("desc");
mod.setName("name");
if (hibsession != null) {
hibsession.save(mod);
HibernateUtil.closeSession();
}
Stack Trace:
10:27:37,787 ERROR [JDBCExceptionReporter] Could not save object
java.sql.SQLException: ORA-02289: sequence does not exist
DB Version: Oracle 8i
|