I am trying to reverse engineer postgresql using hibernate tools in eclipse. It is not generating @Generated annotation. postgres tables have primary key defined with serial keyword. what can be the problem?
Asked
Active
Viewed 226 times
1 Answers
0
You should modify the freemarker templates, and add someting like :
@${pojo.importType("javax.annotation.Generated")}(value = "Generated by Hibernate Tools ${version}", date = "${.now?iso_local}")
For JPA entities, you could add it in pojo/PojoTypeDeclaration.ftl
It works with Hibernate Tools 5.2.3 and Freemarker 2.3.23.
You could also add block comments like :
// Generated ${date} by Hibernate Tools ${version}
// and FreeMarker ${.version}

Guillaume Husta
- 4,049
- 33
- 40