I'm trying to insert a record into an Oracle9i DB and I get the following:
12:55:35,576 - DEBUG SessionFactoryUtils - Opening Hibernate session
12:55:35,677 - DEBUG SessionImpl - opened session
12:55:35,897 - ERROR TableGenerator - could not read a hi value
java.sql.SQLException: ORA-00942: table or view does not exist
I believe this is related to the value for <generator
If I use class="assigned" and assign a primary key to my object the insert will take place. If I change the generator to "native" and assign the unsaved-value I get the above error.
I'm not too clear about how generators work so this is probably a really stupid error on my part but I haven't a clue as to what is going on.
Any help would be appreciated.
Hibernate version=2
Spring version=1.2
DB=Oracle9i
----------------------- Hibernate mapping ----------------------------------
<hibernate-mapping>
<class name="business.models.Party" table="PARTY">
<id name="id" column="PARTY_ID" type="int" unsaved-value="0">
<generator class="native" />
</id>
<property name="name" column="PARTY_NM" />
</class>
</hibernate-mapping>
---------- DB id column info (from DBVisualizer) --------------
table name = PARTY
column name = PARTY_ID
key_seq = 1
pk_name = dtdp_pk
-------Application Code (uses Spring HibernateDaoSupport) --------------
public void insert(Model model)
{
getHibernateTemplate().save(model);
}
When this method is called the model has an id value of 0 and a name value of "party 1"
|