Hello Everyone,
I encounter a problem with Hibernate 2.1.2, jdk1.4 and Oracle 9.2.0.1.
I have a class containing a mapped collection of objects retrieved using the <map> tag in my hibernate_mapping.xml (here is the code)
Code:
<class table="CB_TEMPLATES" name="com.cardiweb.cardibox.contentmanagement.Template">
<id type="long" column="ID_TEMPLATE" name="id" unsaved-value="-1">
<generator class="com.cardiweb.cardibox.components.persistence.HibernateIdGenerator"/>
</id>
<property not-null="true" type="timestamp" column="CREATION_DATE" name="createdTimestamp"/>
<property not-null="true" type="timestamp" column="MODIFICATION_DATE" name="modifiedTimestamp"/>
<property not-null="true" type="string" column="name" name="name"/>
<property not-null="true" type="string" column="description" name="description"/>
<property not-null="true" type="string" column="SHORTCUT" name="shortcut"/>
<property not-null="true" type="serializable" column="code" name="code"/>
<property not-null="true" type="serializable" column="preview" name="preview"/>
<map name="tags" table="cb_template_tags">
<key column="id_template"/>
<index column="tagname" type="string"/>
<element column="tag" type="serializable"/>
</map>
</class>
Everything is ok when I save data to the database.
The problem occurs when I try to get the collection.
The debugger tells me the first part of the object is OK.
But an Exception is thrown when reading the resulset mapping the collection.
Here is the debug log :
[code]
[DEBUG][ SessionImpl][22/07][16:38:04] initializing collection [com.cardiweb.cardibox.contentmanagement.Template.tags#143881672272642048]
[DEBUG][ SessionImpl][22/07][16:38:04] checking second-level cache
[DEBUG][ SessionImpl][22/07][16:38:04] collection not cached
[DEBUG][ BatcherImpl][22/07][16:38:04] about to open: 0 open PreparedStatements, 0 open ResultSets
[DEBUG][ SQL][22/07][16:38:04] select tags0_.tag as tag__, tags0_.id_template as id_templ4___, tags0_.tagname as tagname__ from cb_template_tags tags0_ where tags0_.id_template=?
Hibernate: select tags0_.tag as tag__, tags0_.id_template as id_templ4___, tags0_.tagname as tagname__ from cb_template_tags tags0_ where tags0_.id_template=?
[DEBUG][ BatcherImpl][22/07][16:38:04] preparing statement
[DEBUG][ LongType][22/07][16:38:04] binding '143881672272642048' to parameter: 1
[DEBUG][ Loader][22/07][16:38:04] result set contains (possibly empty) collection: [com.cardiweb.cardibox.contentmanagement.Template.tags#143881672272642048]
[DEBUG][ SessionImpl][22/07][16:38:04] uninitialized collection: initializing
[DEBUG][ Loader][22/07][16:38:04] processing result set
[DEBUG][ Loader][22/07][16:38:04] result row:
[DEBUG][ LongType][22/07][16:38:04] returning '143881672272642048' as column: id_templ4___
[DEBUG][ Loader][22/07][16:38:04] found row of collection: [com.cardiweb.cardibox.contentmanagement.Template.tags#143881672272642048]
[DEBUG][ SessionImpl][22/07][16:38:07] reading row
[DEBUG][ JDBCExceptionReporter][22/07][16:38:13] SQL Exception
java.sql.SQLException: Le flux de donn