Where is the "Reverse Engineering" feature in Hibernate5?

The latest version of the hibernate-maven-plugin is 4.3.1.

You would get out of hibernate 3 by using hibernate 4.3.1 naturally.

It looks like the hbm2java task exists in the sources of the latest hibernate release: https://github.com/hibernate/hibernate-tools/blob/master/main/src/java/org/hibernate/tool/ant/Hbm2JavaExporterTask.java. That is what your were looking for isn't it? So it should also be possible to build the hibernate5 github project in your local maven repo and then bind the dependencies in your projects pom.

At last add the appropriate task and goal in your execution section.


Suggestion#1:

You can use maven ant runner. It may help.

mvn antrun:run@hbm2java

If you have modified templates (see the documentation) then, in pom.xml, modify the hibernate tool tag to look like:

<hibernatetool templatepath="src/the/path/to/the/directory/containing/pojo/directory">

The above path must point to the parent of the directory named pojo, containing your templates.

Also, if you have a custom reverse engineering strategy class the, in pom.xml add this attribute to jdbcconfiguration tag.

reversestrategy="fully.qualified.name.CustomDelegatingReverseEngineeringStrategy"

Resource Link: Hibernate tools reverse engineering using Maven

I haven't checked it but you can try with this procedure using Hibernate 5.X version.


Suggestion#2:

This issue seems critical in Hibernate 5.x version. All recommendation is to use 4.3 version for reverse engineering instead of 5.x

Resource Link: https://stackoverflow.com/a/37577315

Step by step tutorial to use 4.3 instead of 5.1 with pictorial view is given here: http://o7planning.org/en/10125/using-hibernate-tools-generate-entity-classes-from-tables

Some issues are given below:

  1. Database case-sensitive issue
  2. type mapping
  3. table filtering
  4. no <schema-selection> tag is specified

This issues is required to resolve by hand (it's just basic XML) or you can use the Hibernate plugins, which provides a specialized editor. http://www.hibernate.org/30.html

For reverse engineering rule, you can go through this tutorial: Chapter 6. Controlling reverse engineering