-->
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: property-ref and more
PostPosted: Thu Sep 01, 2005 8:49 am 
Newbie

Joined: Thu Sep 01, 2005 6:56 am
Posts: 1
Hi,

I'm new to NHibernate and I have two problems with my mapping.
(I'm using NHibernate 0.9.0.0)

First one:
I'm trying to map a table (many-to-one) by property-ref because
I can't use the primary key. I know that my referenced column need
unique values for this.

the many-end (class FindObject Mapping):
Code:
<many-to-one name="objGroup" class="FindObjectGroup" column="KENNUNG" property-ref="groupID" unique="true"/>


the one-end (class FindObjectGroup Mapping):
Code:
<property name="groupID" unique="true" column="OBJEKTKENNUNG" type="System.String" access="property"/>
<bag name="findObjects" access="property">
  <key column="KENNUNG"/>
  <one-to-many class="FindObject"/>
</bag>


In the rest of these mapping files shoudn't be any further mistakes. These classes are mapped from other classes as well and without the given lines my mapping works fine (There is a second mapping on FindObjectGroup which uses the composite-id of this table and - no problems).

I also tried property-ref attribut with another Class which is mapped by it's simple id primary key (which had already worked). Then I set property-ref attribut to the primary key. In result this mapping didn't work any longer.


Second Problem:
In one mapping file I have two many-to-one associations. Each refer to a separate table mapping with a composite-id. If I use only one of them the mapping is okay. But if I activate both of them my mapping crashes.


The bad thing is, I can't make any changes to the database schema
because it has been using for several years now.

If there are any ideas to my problems I would be really happy.
Thanx a lot
Uwe


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.