Hibernate version: 3.0.5
Mapping documents:
IndexNavigare.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="data">
<class name="IndexNavigare">
<id name="indexId" type="long">
<generator class="assigned"/>
</id>
<property name="entitateId" type="long" not-null="true" />
<property name="lucrareId" type="long" not-null="false" />
<property name="expresieId" type="long" not-null="false" />
<property name="manifestareId" type="long" not-null="false" />
<property name="exemplarId" type="long" not-null="false" />
<property name="autoritateId" type="long" not-null="false" />
<property name="valoareSortare" type="string" not-null="true" />
<property name="valoareAfisare" type="string" not-null="true" />
<sql-insert>INSERT INTO INDEX_NAVIGARE1(ENTITATE_ID, LUCRARE_ID, EXPRESIE_ID, MANIFESTARE_ID, EXEMPLAR_ID, AUTORITATE_ID, VALOARE_SORTARE, VALOARE_AFISARE, IDX_NAVIGARE_ID) VALUES(?,?,?,?,?,?,?,?,?)</sql-insert>
<!-- <sql-insert callable="true">{ call insertIndexNavigare (?, ?, ?, ?, ?, ?, ?, ?, ?) }</sql-insert> -->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
IndexNavigare in = new IndexNavigare(new Long(1));
in.setEntitateId(new Long(1));
in.setLucrareId(new Long(1));
in.setValoareAfisare("valoare afisare p/u lucrarea 1");
in.setValoareSortare("valoare sortare p/u lucrarea 1");
session.save(in);
session.flush();
Name and version of the database you are using: Oracle 10.1.0.2
I found this interesting, because hibernate doesn't give any error but data in database doesn't appear.
This is what hibernate shows:
Code:
. . .
15:56:55,247 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled
15:56:55,248 INFO SettingsFactory:237 - Structured second-level cache entries: disabled
15:56:55,264 INFO SettingsFactory:261 - Statistics: disabled
15:56:55,266 INFO SettingsFactory:265 - Deleted entity synthetic identifier rollback: disabled
15:56:55,268 INFO SettingsFactory:279 - Default entity-mode: pojo
15:56:55,582 INFO SessionFactoryImpl:152 - building session factory
15:56:56,273 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
15:56:56,275 INFO SessionFactoryImpl:379 - Checking 0 named queries
15:56:56,470 DEBUG SQL:324 - INSERT INTO INDEX_NAVIGARE1(ENTITATE_ID, LUCRARE_ID, EXPRESIE_ID, MANIFESTARE_ID, EXEMPLAR_ID, AUTORITATE_ID, VALOARE_SORTARE, VALOARE_AFISARE, IDX_NAVIGARE_ID) VALUES(?,?,?,?,?,?,?,?,?)
15:56:56,800 DEBUG LongType:59 - binding '1' to parameter: 1
15:56:56,802 DEBUG LongType:59 - binding '1' to parameter: 2
15:56:56,808 DEBUG LongType:52 - binding null to parameter: 3
15:56:56,809 DEBUG LongType:52 - binding null to parameter: 4
15:56:56,811 DEBUG LongType:52 - binding null to parameter: 5
15:56:56,812 DEBUG LongType:52 - binding null to parameter: 6
15:56:56,813 DEBUG StringType:59 - binding 'valoare sortare p/u lucrarea 1' to parameter: 7
15:56:56,815 DEBUG StringType:59 - binding 'valoare afisare p/u lucrarea 1' to parameter: 8
15:56:56,816 DEBUG LongType:59 - binding '1' to parameter: 9
15:56:56,999 INFO SessionFactoryImpl:776 - closing
Any information on this wold be very appreciated.