Hi,
Here it is:
Code:
<class name="Vehicle" ...>
<property name="Name"/>
<joined-subclass name="Car" ...>
....
</joined-subclass>
...
</class>
At some point in my criteria, I need to add a SQL query to use MSQL2000 fulltext search.
The code looks like this:
Code:
oCriteria = oSession.CreateCriteria("Car");
...
oCriteria = oCriteria.Add(Expression.Sql("CONTAINS(Name, " + oKeywords + ")));
My query uses some other tables and "Name", as is, becomes ambiguous.
I tried using "{alias}" (i.e. "...CONTAINS({alias}.Name ...") but it doesn't work as the criteria is based on "Car", not "Vehicle" (which makes sense since the query generated is like "...FROM Car this INNER JOIN Vehicle ...", so "this" doesn't refer to Vehicle).
Is there a way I can get that to work?
Can I create a criteria/sub-criteria on the base class?
Any other ideas?
Luc.