I get this error when trying to do like that: System.Data.SqlClient.SqlException: An expression of non-boolean type specified in a context where a condition is expected, near ','. Incorrect syntax near the keyword 'join'.
Not sure if my approach is good. Mapping was already there and I need to write query that will return data for specific index's. Maybe it would better if I change mapping but it would be nice to know how to write query when i have dictionary in DTO. Do you have any suggestion how to do it properly? On Aug 24, 3:43 pm, José F. Romaniello <[email protected]> wrote: > I think index is just for scalar (lets say when you have a list or a map > with "map-key", or "index" in the old syntax). > > I am not sure if you can use here the row-value-constructor syntax here, try > this: > > from OrganisationNode node > inner join node.NodeNamePaths node_paths > where (:id, :mdbid) in indices(node_paths) > > 2010/8/24 zoranpro <[email protected]> > > > Hello, > > > I have problem to write HQL when DTO is having dictionary. > > > This is how mapping is look like: > > <map name="NodeNamePaths" table="SomeTable" cascade="all"> > > <key column="ID" /> > > <composite-index class="OrgID"> > > <key-property name="ID" /> > > <key-property name="ID_mdbID" /> > > </composite-index> > > <element column="NamePath"/> > > </map> > > And in DTO there is prop: IDictionary<OrgID, string> NodeNamePaths > > > I tried writing like this: > > > from OrganisationNode node > > inner join node.NodeNamePaths node_paths > > where index(node_paths).ID = :id and index(node_paths).ID_mdbID > > = :mdbid > > > Error that I get is: > > NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: Exception of type > > 'Antlr.Runtime.NoViableAltException' was thrown. > > > -- > > 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]<nhusers%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en. -- 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.
