Working on a Grails project that needs to access a legacy database, I’ve used the Hibernate Tools for Eclipse and Ant to create annotated EJB3 entity classes.
As the database model uses some peculiar concepts (e.g. char(1) for booleans), I ‘ve created Hibernate custom types that properly map database types to Java types. The Hibernate Reveng Tool can be configured to map certain database columns to custom types, but it fails to create the @Type annotation that is required for custom user types. And as numerous reverse engineering cycle are about to be executed, I didn’t want to fix the generated sources by hand.
There already exists a bug for this problem, but there has been no attempt to fix it during the past two years 😦 Thus I’ve designed a work-around and documented it at Issue HBX-849 – Tools does not insert @Type in POJOs for user types defined in reveng.xml 🙂