-->
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.  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Thu Apr 13, 2006 11:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...I *think* this is because you are actually double defining the foreign key...and currently I don't detect this.

You should be able to workaround this by simply only refer to the foreignkey by constraint-name.

Code:
<foreign-key constraint-name="PK_TBENUTZER_STATUS" >
          <many-to-one property="benutzerStatus"/>
</foreign-key>


I would appreciate if you put this issue into jira so i remember to either error or handle the case.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 6:14 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
max wrote:
hmm...I *think* this is because you are actually double defining the foreign key...and currently I don't detect this.

You should be able to workaround this by simply only refer to the foreignkey by constraint-name.

Code:
<foreign-key constraint-name="PK_TBENUTZER_STATUS" >
          <many-to-one property="benutzerStatus"/>
</foreign-key>


I would appreciate if you put this issue into jira so i remember to either error or handle the case.


hmm this is not working either. If i try it with the workaround above, the property names are wrong again:

Code:
private BenutzerStatus tbenutzerStatus;


instead of
Code:
private BenutzerStatus benutzerStatus;


But at least there is only one tzugang property (i0m still wondering where i can define this name):

Code:
private Set tzugangs = new HashSet(0);


btw: the foreign-key attribute complains about a missing foreign-table argument!

Angela


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 6:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
are you sure the foreign key name actually *is* PK_TBENUTZER_STATUS ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 8:41 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
max wrote:
are you sure the foreign key name actually *is* PK_TBENUTZER_STATUS ?


you were right..this was my fault :-( sorry....

is there also something planned to define the inverse property names, which are created like that in the mapping file? I was looking for this issue in jira but couldn't find something

Code:
<set name="tzugangs" inverse="true">
            <key>
                <column name="FK_TBENU_ILAUFNR" precision="1" scale="9" />
            </key>
            <one-to-many class="najs.model.Zugang" />
        </set>


angela


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 8:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Code:
  <foreign-key constraint-name="benutzerStatus">
          <many-to-one property="benutzerStatus"/>
          <set property="benutzerStatusBlahBlah"/>
      </foreign-key>


...so now you don't get "weird" duplications ? (just to verify so I just need to focus on trying to detect duplicate definitions)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 8:59 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
thanks!

no i don't get "weird" duplications now :-) with the following definition everything works fine:

Code:
<foreign-key constraint-name="FK_TBENU_ILAUFNR" >
         <column-ref  local-column="FK_TBENU_ILAUFNR" foreign-column="ILAUFNUMMER"/>
             <many-to-one property="benutzer"/>
             <set property="zugaenge"/>
      </foreign-key>


btw: i added the issue to jira

kind regards
angela


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 10:29 am 
Newbie

Joined: Tue Apr 18, 2006 6:11 am
Posts: 11
Angela,

was it possible to generate the inverse mapping, where a set is put into the mapping file?

regards,

Gerald


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 4:10 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
Bierbrauer wrote:
Angela,

was it possible to generate the inverse mapping, where a set is put into the mapping file?

regards,

Gerald


Hello Gerald

yes it was possible to create the inverse mapping, just define a set like you see above.

regards,
Angela


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page Previous  1, 2

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.