Thank you paul,
Here is my
hibernate.cfg.xml
=================
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">
java:comp/env/jdbc/iDENOraDS</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect</property>
<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>
</session-factory>
</hibernate-configuration>
and my
Cat.hbm.xml
===========
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="Cat" table="CAT">
<!-- A 32 hex character is our surrogate key. It's automatically
generated by Hibernate with the UUID
pattern. -->
<id name="id" type="string" unsaved-value="null" >
<column name="CAT_ID" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="name">
<column name="NAME" length="16" not-null="true"/>
</property>
<property name="sex"/>
<property name="weight"/>
</class>
</hibernate-mapping>
If you observe hibernate.cfg.xml, I have already set show_sql=true and SQL statement I got through
Tomcat console is as following:
Hibernate: insert into CAT (NAME, sex, weight, CAT_ID) values (?, ?, ?, ?)
Which is perfect.
Even I had the same doubt as that of yours as to whether Oracle supports a "uuid.hex" kind of support for id generation, so I tried changing it to Oracle Sequence (regenerated my Schema using SchemaExport tool) and changing id strategy to "sequence", still the solution did not work. It silently executes all the debug statements I had included in servlet and does not throw any exceptions and ALSO NOT STORING THE "CAT"
Any clues?
Regards
Muthu