I'm having an issue executing a search for all polymorphic types using the Criteria API.
I have the following classes:
- AbstractClassA
- ClassB extends AbstractClassA
- ClassC extends AbstractClassA
AbstractClassA has properties of type
TEXT
Code:
Criteria criteria = session.createCriteria(AbstractClassA .class, "ae");
List results = criteria.list();
Unfortuantely
SQLServer 2005 spits out the exection:
Quote:
SEVERE: The text data type cannot be selected as DISTINCT because it is not comparable.
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
at ...
The resulting sql is actually a union on the tables that represent ClassB and ClassC. On the microsoft forum this is listed as an issue, does anyone have a work around?
http://forums.microsoft.com/MSDN/ShowPo ... 7&SiteID=1
Thanks.