Hi All,
I am trying to use Hibernate Filters and apply filtering on User defined Types. It seems Hibernate Filters are unable to map to columns having user defined types.
Also, I am not sure if in the filter-def configuration the type used should be String or the EnumType
All the details are given below.
Can anybody please help!!!
Regards,
Shardul.
Hibernate version:
Code:
Hibernate 3
Mapping documents:Excerpt of Mapping Doc
User Defined Type
Code:
<typedef name="courseLengthUnitType"
class="module.commons.dao.tool.EnumUserType">
<param name="enumClassName">
module.xxxx.model.type.LengthUnitType
</param>
</typedef>
<class>
<property name="lengthUnit" type="courseLengthUnitType">
<column name="length_unit" length="32" not-null="false"/>
</property>
<filter name="courseYearLengthUnitFilter" condition="lengthUnit IN (:courseYearLengthUnit)"></filter>
</class>
<filter-def name="courseYearLengthUnitFilter">
<filter-param name="courseYearLengthUnit" type="java.lang.String"></filter-param>
</filter-def>
Full stack trace of any exception that occurs:Code:
19:01:38,866 ERROR [JDBCExceptionReporter] Unknown column 'this_.lengthUnit' in 'where clause'
Name and version of the database you are using:Code:
MySQL 5.0
The generated SQL (show_sql=true):Code:
Hibernate: select this_.id as y0_ from core_course this_ where length IN (?) and this_.lengthUnit IN (?) and this_.degreeType IN (?)