-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: could not read a hi value
PostPosted: Tue Aug 30, 2005 1:23 pm 
Newbie

Joined: Tue Aug 30, 2005 12:02 pm
Posts: 7
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"


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.