0

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?

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
ArslanAnjum
  • 1,674
  • 2
  • 17
  • 31

1 Answers1

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