I am trying to execute the following HQL query:

from Staff x
 where x.ExtendedProperties['HmriNumber'].SmallValue like ?
 order by x.Name.FamilyName asc

where ExtendedProperties is a IDictionary<string, ExPropValue> where
ExPropValue is defined as

class ExPropValue
{
  public string SmallValue { get; set; }
  public string LargeValue { get; set; }
}

and is mapped as a User-defined type.  The collection mapping looks
like this:

<map name="ExtendedProperties" lazy="true"
table="StaffExtendedProperty_">
  <key column="StaffOID_"/>
  <index column="Name_" type="String"/>
  <element type="ExtendedPropertyValueHbm">
        <column name="Value_" length="65000"/>
        <column name="SmallValue_" length="128"/>
  </element>
</map>

It throws an exception with the error message "cannot create element
join for a collection of non-entities".  Is there any reason this
should be the case?  It seems to me intuitively that this query should
be fairly easily translatable to SQL.

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