-->
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.  [ 4 posts ] 
Author Message
 Post subject: Middlegen and one-to-one with composite keys
PostPosted: Fri Apr 21, 2006 7:11 pm 
Newbie

Joined: Fri Apr 21, 2006 6:53 pm
Posts: 2
I am attempting to use middlegen to generate hbms for two classes in a one-to-one relation with composite keys. However, rather than using a shared class (call it PKClass) for the composite key in each class, middlegen generates seperate classes for each composite id (Class1PK and Class2PK). Here is essentially (irrelevant parts removed) what I get:

<class name="Class1">
<composite-id name="comp_id" class="Class1PK">
<key-property name="field1" column="column1">
<key-property name="field2" column="column2">
</composite-id>

<one-to-one
name="class2"
class="Class2"
outer-join="auto">

</class>

<class name="Class2">
<composite-id name="comp_id" class="Class2PK">
<key-property name="field1" column="column1">
<key-property name="field2" column="column2">
</composite-id>

<one-to-one
name="class1"
class="Class1"
outer-join="auto">

</class>

In order for this mapping to work properly, I just manually make the composite-id classes the same (i.e. both Class1PK), but I wondering if I am missing an option in middlegen that will do this for me.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 21, 2006 8:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
This was one of the pains I had when I implemented this stuff. It should be working fine - atleast it was the last time I looked at it in any detail. What version are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 11:38 am 
Newbie

Joined: Fri Apr 21, 2006 6:53 pm
Posts: 2
I am using 2.1, also seem to get the same result from the latest (2.2-dev) in cvs.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 26, 2006 2:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hmmm... OK Thanks. Create a SF Bug tracker entry for it if you don't mind.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.