max wrote:
Why is the class not found ?
It should be in the classpath, right ? That is what you do with all custom types.
May be a sample explains more clearly what I try to do. See some hbn.xml fragment below:
<typedef name="EmployeeActivityType" class="com.sample.hbn.EnumUserType">
<param
name="enumClassName">com.sample.model.MyLittleEnum</param>
<param
name="enumSqlType">INTEGER</param>
</typedef>
...
<class>
...
<property name="activityType" column="activity_type" type="EmployeeActivityType"/>
...
</class>
The EnumUserType I am using is more or less based on the GenericEnumUserType in
http://www.hibernate.org/272.html,
with the addition that the Sql type is taken from the hbn.xml file.
The point is that the class com.sample.model.MyLittleEnum is NOT available when the classes are generated. This class is in the destination project, where it can be compiled together with the by the tool generated java classes. In some of the projects I am in, this would be a big win.
When the EnumUserType would not be asked for the actual class (though the returnedClass method in EnumUserType, but just for the name, the problem would be solved.