How to remove this comment generated by Hibernate:
package com.mypackage.db.entity;
// Generated Oct 20, 2015 4:03:57 PM by Hibernate Tools 4.3.1.Final
import ...
The comment appears every time I try to reverse engineer a database model. I've also tried to override some methods like tableToClassName
and tableToMetaAttributes
using my own renaming strategy by extending to the DelegatingReverseEngineeringStrategy
but these comments still appear in my entity classes.
I would like to know how these comments can be disabled/removed when generating the entity classes.
It helps to read the documentation: Controlling POJO Codegeneration
There is an example on how to change a generation template. In your case this would be pojo/Pojo.ftl
.
So create a custom template directory (I call it CUSTOM_TEMPLATES
) and copy hibernate-tools.jar/pojo/Pojo.ftl
to CUSTOM_TEMPLATES/pojo/Pojo.ftl
. Change the file and remove the line
// Generated ${date} by Hibernate Tools ${version}
All you need to do now is to specify the custom template directory for the tool:
<hibernatetool ... templatepath="CUSTOM_TEMPLATES">