-->
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.  [ 1 post ] 
Author Message
 Post subject: One-to-one problem with hbm2ddl using composite id
PostPosted: Wed Feb 09, 2005 11:26 pm 
Newbie

Joined: Thu Jan 27, 2005 4:24 pm
Posts: 2
Hi All,

I've been driving myself crazy trying to get a one-to-one bi-directional association working but cannot get hbm2ddl to generate. After going through all sorts of hoops to do with incorrect column numbers I have become stuck with the following error when running hbm2ddl:

"Schema text failed: Could not determine type for column ContractNumber of type org.hibernate.type.SerializableType: java.lang.ArrayIndexOutOfBoundsException"

The two mapping files are:

<hibernate-mapping>

<class
name="domain.Contract"
table="ContractHeader">

<composite-id name="pk" class="domain.PkContract">
<key-property
name="branchNumber"
type="short"
column="BranchNumber" />
<key-property
name="contractNumber"
type="integer"
column="ContractNumber" />
</composite-id>

<one-to-one
name="entryContract"
class="domain.EntryContract" />

<!-- other properties removed -->

</class>

</hibernate-mapping>

<hibernate-mapping>

<class
name="domain.EntryContract"
table="EntryContractHeader">

<id name="pk" type="domain.PkContract">
<column name="BranchNumber" />
<column name="ContractNumber" />
<generator class="foreign">
<param name="property">contract</param>
</generator>
</id>

<one-to-one
name="contract"
class="domain.Contract"
constrained="true"
/>

<!-- other properties removed -->

</class>

</hibernate-mapping>

I'd really appreciate any help I could get on this one.

Thanks

Mike


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

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.