Another question concerning this toppic:

Is it possible to use a property path on the property-ref element?


Somethink like this:

class Entity1 {
   public string Name {get;set;}
}

class Entity2 {
   public Entity1 Element {get;set;}
}

<class name="Entity2" ....>
...
<key ...... property-ref="Element.Name"/>
...
</class>

On 1 Jul., 12:48, Maik <[email protected]> wrote:
> I know, that this is a bad design, but we also use a legacy database.
> Thanks for your help!
>
> On 1 Jul., 12:04, Stefan Steinegger <[email protected]>
> wrote:
>
> > You should actually avoid this.
>
> > If have to cope with a legacy database, use property-ref:
>
> > class Class1
> > {
> >   //...
> >   public Guid BusinessId { get; set; }
>
> > }
>
> > class Class2
> > {
> >   //...
> >   public MyClass1 { get; set; }
>
> > }
>
> > <class name="Class2" table="TABLE2">
> >   <!-- ... -->
> >   <many-to-one
> >     name="MyClass1"
> >     class="Class1"
> >     property-ref="BusinessId"
> >     column="MyTAB1" />
> > </class>
>
> > On 1 Jul., 08:40, Maik <[email protected]> wrote:
>
> > > Hi folks,
>
> > > I have a question, because I couldn't find it by flying through the
> > > manual and google.
>
> > > How do I map a relation on a UniqueKey in the foreign Table?
>
> > > I mean sth. like this:
>
> > > TABLE1:
> > > ID *(PK)
> > > BUSINESS_ID (Unique or NULL)
> > > NAME
>
> > > TABLE2:
> > > ID *(PK)
> > > MY_TAB1 (FK to TABLE1 by BUSINESS_ID)
> > > INFORMATION
>
> > > Thanks for your help
>
> > > Regards,
> > > Maik
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to