[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7227) distinct query in sql server when table contains text field
Rafal Figas (JIRA)
noreply at atlassian.com
Thu Apr 5 11:00:48 EDT 2012
distinct query in sql server when table contains text field
-----------------------------------------------------------
Key: HHH-7227
URL: https://hibernate.onjira.com/browse/HHH-7227
Project: Hibernate ORM
Issue Type: Improvement
Affects Versions: 3.6.9
Environment: SQL Server 2008, Microsoft SQL Server JDBC driver
Reporter: Rafal Figas
When SQL Server 2008 is used to run HQL query:
"select distinct a from A a"
and A contains field(s) mapped as type text exception is thrown:
com.microsoft.sqlserver.jdbc.SQLServerException: The text data type cannot be selected as DISTINCT because it is not comparable.
I don't know if it is even possible, but maybe it would be convenient to generate SQL query without distinct and then perform result transformation in cases where SQL Server dialect is used.
I've filed it as improvement, because it doesn't seem to be hibernate bug and there is workaround. Non-distinct results may be programmatically filtered out using org.hibernate.transform.DistinctResultTransformer.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list