I try to query a collection with composite user type elements without
success.

<map name="Values" access="field.camelcase" table="T_Values"
lazy="true" cascade="all"  fetch="subselect">
      <cache usage="nonstrict-read-write" region="Cached" />
      <key column="c_v_owner" />
      <index column="c_v_index" type="String" />
      <element
type="Cinortus.Architecture.Persistence.NHibernateUserTypes.ValueTypeUserType,
Cinortus.Architecture.Persistence.NHibernateUserTypes">
         <column name="Type" sql-type="TEXT" />
         <column name="Value" sql-type="TEXT" />
      </element>
   </map>

The composite user type defines 'Type' and 'Value' as property names.

The query is:

select c  from ComplexDatabaseObject c join c.Values v where
c.ObjectTypeName = 'Cinortus.Localization.Persistence.ILanguage' AND
v['Number'].Value != :cultureInfo"

The parameter cultureInfo is set using:

query.SetParameter(key, valueTypeParameter.Parameter,
NHibernateUtil.Custom(typeof(ValueTypeUserType)));

The Error i got is:

System.InvalidOperationException at
NHibernate.Hql.Ast.ANTLR.Tree.IdentNode.ResolveIndex(IASTNode parent)
in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Hql\Ast\ANTLR\Tree
\IdentNode.cs:Zeile 81.

My question:
* is it possible to execute queries on user type collections?
* and if yes how?

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