I am trying to add an Oracle function to a Criteria call that maps
back to a domain object.

I have a custom criterion that adds a "CONTAINS('fulltextcolumn, 'Foo
Bar', 1) > 0" item to the where clause.  To make that useful I need to
inject a SCORE(1) in the column select and order by statement:

SELECT
     Id,
     Name,
     SCORE(1)
FROM
     Widgets
WHERE
     CONTAINS('fulltextcolumn', 'Foo Bar', 1) > 0
ORDER BY
     SCORE(1)

When I try to do this it doesn't seem to be happy with the results:

    criteria.SetProjection(Projections.ProjectionList()
        .Add(Projections.SqlProjection("SCORE(1)",
                                       new string[] { "Score" },
                                       new NHibernate.Type.IType[]
{ NHibernateUtil.Int32 })));
        .AddOrder(Order.Desc("Score"));

This could be a result that there isn't a Score value in the domain
object that it tries to map back towards.  How do I include this
clause in the query but ignore it on the map back?

Thanks,
Colin
--~--~---------~--~----~------------~-------~--~----~
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