I tried to use uuix.hex when I generate id. I am using spring, oracle 9i, hibernate.
I have error when i tried to save new student record into database.
Here is error:
"Object of class [org.alllearn.model.Student] with identifier []: not found "
In oracle, I use trigger that generate id using SYS_GUID()
How can I do it?
<?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>
<!--
Created by the Middlegen Hibernate plugin 2.1
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="org.alllearn.model.Student"
table="STUDENT"
>
<id
name="id"
type="java.lang.String"
column="ID"
length="32"
>
<generator class="uuid.hex"/>
</id>
<property
name="customerId"
type="java.lang.Long"
column="CUSTOMER_ID"
unique="true"
length="22"
/>
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: