-->
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: very ¿simple? question
PostPosted: Thu Jul 19, 2012 6:08 am 
Newbie

Joined: Thu Jul 19, 2012 5:51 am
Posts: 1
Hi, I'm trying to make a set with special needs and I have read a lot of page without luck.

Lets suppose that I have a mapping of a Sql View

<class name="Namespace.ViewName, Assembly" table="ViewName">

<id name="MyColumnIdOfThisView" column="[MyColumnIdOfThisView]" type="System.Guid">
<generator class="assigned"/>
</id>
<property name="AForeignKey" column="[AForeignKey]" access="field.pascalcase-underscore" not-null="true" type="System.Guid"/>

</class>

And lets suppose that I have other mapping like this:


<class name="Namespace.MyClassName, MyAssembly" table="MyClassName" >

<id name="Id" column="MyClassIdColumnName" type="System.Guid"><generator class="guid"/></id>
<property name="AForeignKey" column="AForeignKey" access="field.pascalcase-underscore" not-null="false" type="System.Guid" insert="true" update="true"/>

</class>


Where AForeignKey from view and AForeignKey from class store the same values, so we can make a inner join but are named different. For example: CaseID, AssociatedID


What I want to do is a mapping of set using this foreign keys. Something like this (in the view)

<set name="MyClassNameList" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore">
<Source key>
<column name="CaseID" />
</Source key>
<Target key>
<column name="AssociatedID"/>
</Target key>
<one-to-many class="MyNamespace.MyClassName, GIOFACT_DAL"/>
</set>

Is this possible?
A lot of thanks in advance!

Best,


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.