-->
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.  [ 9 posts ] 
Author Message
 Post subject: PreparedStatement column index out of range
PostPosted: Thu Apr 21, 2005 5:52 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
It seems that Hibernate generates a PreparedStatement with less parameters then it is trying to bind. In the debugger the Jdbc3PreparedStatement instance contains a paramValues array of 15 slots. The debug output from Hibernate counts 16 positions. So the debug output does not show the actual PreparedStatement that is actually executed. Why does Hibernate tells me that it created a PreparedStatement with 16 parameters when it actually creates a PreparedStatement with 15 parameters and then tries to bind 16 parameters. This is not right. Other classes with less attributes are persisted to the database without problems. The code that produces this error is a simple save() nothing fancy. Create an instance set values and save. This particular problem did not occur with Hibernate v3beta1.

Hibernate version:3.0.1

Name and version of the database you are using:Postgres 8 JDBC 3

Debug level Hibernate log excerpt:
7485 [main] DEBUG org.hibernate.util.JDBCExceptionReporter - could not insert: [nl.tresparc.model.TDUserDomain] [insert into TDModelObject (version, acl, label, parent_id, stringValue, creationDate, closedDateTime, typePath, domainId, last_login, is_locked, administrator, password, owner, class, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'nl.tresparc.model.TDUserDomain', ?)]
org.postgresql.util.PSQLException: The column index is out of range: 16, number of columns: 15.


Top
 Profile  
 
 Post subject: Jdbc3PreparedStatement Class
PostPosted: Thu Apr 21, 2005 8:34 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
More info.

The Jdbc3PreparedStatement contructor is passed the sql variable with the value of

"insert into TDModelObject (version, acl, label, parent_id, stringValue, creationDate, closedDateTime, typePath, domainId, lastLoginDate, locked, administrator, password, owner, class, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'nl.tresparc.model.TDUserDomain', ?)"

The parameter count is 16. When the Jdbc3PreparedStatement object is created the preparedParameterList.paramValues[] only counts 15 slots.

So the fault lies in the PostgreSQL JDBC3 drivers and not in Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 9:02 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
After some more debugging in the JDBC driver I found out that the fault is not in the JDBC driver. I asumed wrong.

The fault is somewhere in the SingleTableEntityPersister. My knowledge of Hibernate fails short to further understand what is going on.

Anybody else having similar problems.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 2:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
as you havent shown anything about what you did to get this error we cant help much

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 2:28 pm 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
Thanks for the reply.

There is nothing much to it. A simple object creation and a save.

...
TDUserDomain domain = new TDUserDomain(root.getTypePathRoot(),
domainType, domainId, domainName);

currentSession().save(domain);
...

constructor signature is:

TDUserDomain(
TDTypePath typePathRoot,
TDComplexType domainType,
String domainId,
String name)

Creating and persisting instances of the TDComplexType and TDTypePath give no problem.

The same class model did work in version 2.1.x and 3alpha1.

TDUserDomain is subclass of TDDomain is a subclass of TDItem is a subclass of TDModelObject.

The mapping file for the TDModelObject class hierarchy.


<?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>
<class
name="nl.tresparc.model.TDModelObject"
dynamic-update="false"
dynamic-insert="false"
discriminator-value="nl.tresparc.model.TDModelObject"
>

<id
name="id"
column="id"
type="long"
access="field"
unsaved-value="null"
>
<generator class="native">
</generator>
</id>

<discriminator
type="string"
/>

<version
name="version"
type="timestamp"
column="version"
access="field"
/>

<many-to-one
name="acl"
class="nl.tresparc.model.TDAcl"
cascade="all"
outer-join="auto"
update="true"
insert="true"
access="field"
column="acl"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDModelObject.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="nl.tresparc.model.TDProperty"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="cardinality"
type="int"
update="true"
insert="true"
access="field"
column="cardinality"
/>

<many-to-one
name="parent"
class="nl.tresparc.model.TDComplexType"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="parent_id"
/>

<many-to-one
name="type"
class="nl.tresparc.model.TDComplexType"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="type_id"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDProperty.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDEnumerationEntry"
dynamic-update="false"
dynamic-insert="false"
>
<property
name="label"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="label"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDEnumerationEntry.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDCurrency"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="isoCode"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="isoCode"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDCurrency.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDComplexType"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="internalName"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="internalName"
/>

<property
name="name"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="name"
/>

<property
name="view"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="pgview"
/>

<property
name="icon"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="icon"
/>

<many-to-one
name="baseType"
class="nl.tresparc.model.TDComplexType"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="base_type_id"
/>

<list
name="typeProperties"
lazy="false"
inverse="false"
access="field"
cascade="save-update"
>

<key
column="parent_id"
/>

<index
column="parent_idx"
/>

<one-to-many
class="nl.tresparc.model.TDProperty"
/>
</list>

<property
name="itemClassName"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="itemClassName"
/>

<property
name="namespace"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="namespace"
/>

<property
name="cardinality"
type="int"
update="true"
insert="true"
access="field"
column="cardinality"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDComplexType.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDItem"
dynamic-update="false"
dynamic-insert="false"
>
<property
name="label"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="label"
/>

<many-to-one
name="owner"
class="nl.tresparc.model.TDDomain"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="owner"
/>

<many-to-one
name="parent"
class="nl.tresparc.model.TDItem"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="parent_id"
not-null="false"
/>

<property
name="stringValue"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="stringValue"
/>

<list
name="children"
lazy="true"
inverse="false"
access="field"
cascade="all"
>

<key
column="parent_id"
/>

<index
column="parent_idx"
/>

<one-to-many
class="nl.tresparc.model.TDItem"
/>
</list>

<property
name="creationDate"
type="long"
update="true"
insert="true"
access="field"
column="creationDate"
/>

<property
name="closedDateTime"
type="java.lang.Long"
update="true"
insert="true"
access="field"
column="closedDateTime"
/>

<many-to-one
name="typePath"
class="nl.tresparc.model.TDTypePath"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="typePath"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDItem.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="nl.tresparc.model.TDEmailAddressItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="email"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="email"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDEmailAddressItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDDBCItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDBCItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDDateItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="internalDate"
type="long"
update="true"
insert="true"
access="field"
column="internalDate"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDateItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDConfigurationItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDConfigurationItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDMemberInGroupItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDMemberInGroupItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDIndexEntryItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDIndexEntryItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDMultilineStringItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="string"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="string"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDMultilineStringItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDDateTimeItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="dateTime"
type="long"
update="true"
insert="true"
access="field"
column="dateTime"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDateTimeItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDEMDItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDEMDItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDHyperlinkItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="url"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="url"
/>

<property
name="newWindow"
type="boolean"
update="true"
insert="true"
access="field"
column="newWindow"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDHyperlinkItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDReferenceItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="since"
type="long"
update="true"
insert="true"
access="field"
column="since"
/>

<many-to-one
name="reference"
class="nl.tresparc.model.TDItem"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="reference_id"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDReferenceItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDEMDManager"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDEMDManager.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDMemberOfGroupItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDMemberOfGroupItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDAmountItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="amount"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="amount"
/>

<property
name="currency"
type="nl.tresparc.model.TDCurrency"
update="true"
insert="true"
access="field"
column="currency"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDAmountItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDExclusivePropertyItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDExclusivePropertyItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDOwnGroupItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDOwnGroupItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDIndexItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDIndexItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDAppointmentItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDAppointmentItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDTimeItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDTimeItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDFileItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="mimeType"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="mimeType"
/>

<property
name="content"
type="binary"
update="true"
insert="true"
access="field"
column="content"
/>

<property
name="fileSize"
type="long"
update="true"
insert="true"
access="field"
column="fileSize"
/>

<property
name="compression"
type="int"
update="true"
insert="true"
access="field"
column="compression"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDFileItem.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="nl.tresparc.model.TDDocumentItem"
dynamic-update="false"
dynamic-insert="false"
>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDocumentItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDPictureItem"
dynamic-update="false"
dynamic-insert="false"
>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDPictureItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>

</subclass>
<subclass
name="nl.tresparc.model.TDWasteBasketItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDWasteBasketItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDEnumerationItem"
dynamic-update="false"
dynamic-insert="false"
>

<many-to-one
name="choice"
class="nl.tresparc.model.TDEnumerationEntry"
cascade="all"
outer-join="auto"
update="true"
insert="true"
access="field"
column="choice"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDEnumerationItem.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="nl.tresparc.model.TDDBCState"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDBCState.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>

</subclass>
<subclass
name="nl.tresparc.model.TDPasswordItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDPasswordItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDNumberItem"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="number"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="number"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDNumberItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDOwnerOfGroupItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDOwnerOfGroupItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDRepresentativeInGroupItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDRepresentativeInGroupItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDDomainManagerItem"
dynamic-update="false"
dynamic-insert="false"
>

<many-to-one
name="managedGroup"
class="nl.tresparc.model.TDGroupDomain"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="manager_group_id"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDomainManagerItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDRepresentativeOfGroupItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDRepresentativeOfGroupItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDStringItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDStringItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDAgendaItem"
dynamic-update="false"
dynamic-insert="false"
>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDAgendaItem.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDDomain"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="domainId"
type="java.lang.String"
update="true"
insert="true"
access="field"
column="domainId"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDomain.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="nl.tresparc.model.TDGroupDomain"
dynamic-update="false"
dynamic-insert="false"
>

<list
name="members"
lazy="false"
inverse="false"
access="field"
cascade="none"
>

<key
column="group_id"
/>

<index
column="member_idx"
/>

<many-to-many
class="nl.tresparc.model.TDDomain"
column="member_id"
outer-join="auto"
/>

</list>

<list
name="representatives"
lazy="false"
inverse="false"
access="field"
cascade="none"
>

<key
column="group_id"
/>

<index
column="representative_index"
/>

<many-to-many
class="nl.tresparc.model.TDDomain"
column="representative_id"
outer-join="auto"
/>

</list>

<many-to-one
name="managedBy"
class="nl.tresparc.model.TDDomainManagerItem"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="managed_by"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDGroupDomain.xml
containing the additional properties and place it in your merge dir.
-->
<subclass
name="nl.tresparc.model.TDEveryoneGroup"
dynamic-update="false"
dynamic-insert="false"
>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDEveryoneGroup.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>
<subclass
name="nl.tresparc.model.TDOrganizationDomain"
dynamic-update="false"
dynamic-insert="false"
>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDOrganizationDomain.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>

</subclass>
<subclass
name="nl.tresparc.model.TDUserDomain"
dynamic-update="false"
dynamic-insert="false"
>

<property
name="lastLoginDate"
type="long"
update="true"
insert="true"
access="field"
column="lastLoginDate"
/>

<property
name="locked"
type="boolean"
update="true"
insert="true"
access="field"
column="locked"
/>

<property
name="administrator"
type="boolean"
update="true"
insert="true"
access="field"
column="administrator"
/>

<property
name="password"
type="binary"
update="true"
insert="true"
access="field"
column="password"
/>

<many-to-one
name="owner"
class="nl.tresparc.model.TDDomain"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="field"
column="owner"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDUserDomain.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>

</subclass>

</subclass>
<subclass
name="nl.tresparc.model.TDDomainSize"
dynamic-update="false"
dynamic-insert="false"
>
<property
name="currentSize"
type="long"
update="true"
insert="true"
access="field"
column="currentSize"
/>

<property
name="lastCalculatedSize"
type="long"
update="true"
insert="true"
access="field"
column="lastCalculatedSize"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-TDDomainSize.xml
containing the additional properties and place it in your merge dir.
-->

</subclass>

</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2005 2:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok this is not a simple example....please try to minimize it

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2005 3:11 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
I will try.

First I would like to know if the mapping files are read and processed without error by the SessionFactory may I conclude that the mapping files are valid?

If so then the fault is not the result of an invalid mapping file, right?

The generated sql string passed on to the PreparedStatement is in fact correct. Only the parameter binding goes wrong.

I will step trace the binding process in more detail and report on that.

Brgds,

Eduard


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2005 3:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you can assume hibernate havent found anything wrong with it - but that does not mean they are correct ,)

you have alot of update="false", insert="false" and you might have triggered a bug or mapped something redundantly that hibernate havent detected .... only way to find out is to cut it down to what actually fails.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2005 7:29 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
max wrote:
you can assume hibernate havent found anything wrong with it - but that does not mean they are correct ,)

you have alot of update="false", insert="false" and you might have triggered a bug or mapped something redundantly that hibernate havent detected .... only way to find out is to cut it down to what actually fails.


Thanks Max, that last remark about redundant mapping made me scrutinise the mapping files and found that an overloaded method produced a duplicate definition. The mapping file contains 2 "owner" declarations in the TDItem and TDUserDomain subclasses. Although the overloaded method did not have any Hibernate annotation, XDoclet produced a duplicate statement in both class definitions.

I wrongly asumed that the SessionFactory would be complaining about the redundant declaration. I also do not trust XDoclet anymore :(

Anyway thanks for your time on this matter.


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

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.