Hibernate version: 3.0.5
The mapping:
Code:
<property name="xmlOutputFormatEnabled" column="'xml' = lower(output_format)" type="boolean" />
produces the SQL:
Code:
this_.'xml' = lower(output_format) as column31_52_0_
while
Code:
<property name="xmlOutputFormatEnabled" column="lower(output_format) = 'xml'" type="boolean" />
produces the SQL:
Code:
this_.lower(output_format) = 'xml' as column31_52_0_
Both SQL samples are wrong, as soon as Hibernate puts a table alias before the string constant or the standart SQL function. I have checked up the Hibernate sources: the function is there:
Code:
./org/hibernate/dialect/MySQLDialect.java:55: registerFunction("lower", new StandardSQLFunction("lower") );
Please, give a hint, how to use standard SQL function in formula-attribute like above.