Hi again,
I have a solution for my problem but I do not really like it and hope to get some comments or alternatives.
I now use to_char() at all places where I comapre a column of type CLOB with a parameter like in this example:
HQL> from MyEntity where to_char(title) = :title
I subclassed the SQL server dialect (org.hibernate.dialect.SQLServerDialect) and registered the to_char() function in the constructor with an empty SQL function:
Code:
public class SQLServerDialectSupportingToCharFunction extends SQLServerDialect
{
public UnicodeSQLServerDialect()
{
super();
registerFunction("to_char", new StandardSQLFunction("", Hibernate.STRING));
}
}
The result is that hibernate generates SQL where the property is in brackets (e.g. select ... from ... where (entity.title) = ?).
I don't like the solution becauses I made changes to the SQL server dialect instead of changing the Oracle dialect to get the comparission right.
Thanks for any comment.
Christiain.