-->
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.  [ 3 posts ] 
Author Message
 Post subject: problems with many-to-one
PostPosted: Wed Apr 26, 2006 4:30 am 
Newbie

Joined: Fri Jan 13, 2006 10:20 am
Posts: 7
Hi, I have a problem with using of many-to-one.
I have a xml that describes a table like this:

<class name="ObjectModel.TableParent, ObjectModel" table="TableParent">
<id name="Id" type="Int32" column="Id"
access="field.pascalcase-m-underscore">
<generator class="identity" />
</id>
<version name="RowVersion" column="RowVersion" type="Int32" />
<bag name="assetscopedetails" inverse ="false" cascade="all">
<key column="IdParent" />
<one-to-many class="ObjectModel.TableChild,
ObjectModel" />
</bag>
<property name=....>
.
.
.
</class>

The problem is that I want make join not by id field of the Parent table but by another field, and I not know how make this.

Someone can help me?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 8:55 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
Please provide the full mappings for both ObjectModel.TableParent and ObjectModel.TableChild. Alternately, provide the table structure for each.

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 8:12 am 
Newbie

Joined: Fri Jan 13, 2006 10:20 am
Posts: 7
<?xml version="1.0" encoding="utf-8" ?>
<!-- Generated by ObjectMapper 14/04/2006 9.58.46. http://www.puzzleframework.com -->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" schema="dbo">
<class name="ObjectModel.Auth.Permission, ObjectModel" table="Auth_Permission" mutable="false">
<id name="IdView" type="Guid" column="IdView" access="field.pascalcase-m-underscore">
<generator class="assigned" />
</id>
<property name="CanCreate" column="CanCreate" type="Boolean" />
<property name="CanDelete" column="CanDelete" type="Boolean" />
<property name="CanExecute" column="CanExecute" type="Boolean" />
<property name="CanRead" column="CanRead" type="Boolean" />
<property name="CanUpdate" column="CanUpdate" type="Boolean" />
<property name="Caption" column="Caption" type="String" />
<property name="IdAction" column="IdAction" type="Int32" />
<bag name="propertypermissions" inverse ="false" cascade="all">
<key column="IdAction" />
<one-to-many class="ObjectModel.Auth.PropertyPermission, ObjectModel" />
</bag>
</class>

<class name="ObjectModel.Auth.PropertyPermission, ObjectModel" table="Auth_PropertyPermission" mutable="false">
<id name="IdView" type="Guid" column="IdView" access="field.pascalcase-m-underscore">
<generator class="assigned" />
</id>
<property name="IsAllowed" column="IsAllowed" type="Boolean" />
<property name="PropertyName" column="PropertyName" type="String" />
<property name="Label" column="Label" type="String" />
<property name="ClassPropertyName" column="ClassPropertyName" type="String" />
<property name="IdAction" column="IdAction" type="Int32" />
<property name="IdProperty" column="IdProperty" type="Int32" />
</class>
</hibernate-mapping>

ParentTable is Auth_Permission
ChildTable is Auth_PropertyPermission


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