I'm trying to use a user-defined type in Hibernate Tools reverse engineering.
Where do I specify the class path to make the tools recognize a user-defined type?
There seems to be something for Ant tasks, but I couldn't find a documentation for the equivalent in Hibernate Tools. (I'm not even sure whether this goes into hibernate.reveng.xml or in hibernate.cfg.xml.)
Any help appreciated!
Jo
For reference, some details about what I'm doing (heavily stripped&anonymized to keep the size down and protect the guilty):
hibernate.reveng.xml has this in a <table> section:
Code:
<column name="SOME_COLUMN" type="user_defined_type"></column>
Here's the user-defined class in the project:
Code:
package my.project.lib.hibernate;
import ...
import org.hibernate.type.BooleanType;
public class UserDefinedType extends BooleanType {
...
@Override
public String getName () {
return "user_defined_type";
}
}
I expected the generated Pojo to have
Code:
private Boolean someColumn;
((EDIT: plus a @Type annotation on the field to invoke the mapping, and maybe @TypeDef(s) somewhere else,)) but it had
Code:
private user_defined_type someColumn;
(Yes I need a user-defined Boolean hibernate type, the database can contain ' ' or 'N' for Boolean.FALSE. Besides, I'll want to do enums next.)