I'm stuck on another problem and spend last couple of days solving it
but no one seems to have solution to that.

Problem is:

I have a Lists table:

ListItemId     ListName      Value
----------         ------------       ----------------
1                 AddressType  Home
2                 AddressType  Office
3                 AddressType  Mailing
1                 Region          USA
2                 Region          Canada

Composite PK: ListItemId  & ListName

Then I have Customer table.

CustomerId    Name  RegionId
----------          -------     -------
1                 John      2


In Customer.hbm.xml I tried following with no luck:

<many-to-one name="Region">
    <formula>Region</formula>
    <column name="RegionId" />
</many-to-one>

I get this error:

property mapping has wrong number of columns:
VMI.Domain.Customer.Region type: VMI.Domain.Lists

Also tried <formula>'Region'</formula> but same error.

Then I tried:
<many-to-one name="Region">
    <column name="'Region'" />
    <column name="RegionId" />
</many-to-one>

I get this:
Incorrect syntax near 'Region'.

SELECT this_.CustomerId as CustomerId18_4_, this_.'Region' as
column2_18_4_

Is it possible to avoid this_ on Hibernate generated queries ?


Note: I'm using Spring.Net & NHiberante 2.1. Spring.Net doesn't seems
to support NH 3.

Thanks,
Zeeshan

-- 
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