When I run hbm2java I would like it to create Entity classes that:
import jakarta.persistence
rather than (as currently)
import javax.persistence
I am invoking hbm2java from a Maven build thus:
<plugin>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tools-maven-plugin</artifactId>
<version>5.6.15.Final</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>hbm2java</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>PACKAGE_NAME</packageName>
<outputDirectory>OUTPUT_DIR</outputDirectory>
<ejb3>true</ejb3>
</configuration>
<dependencies>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.32</version>
</dependency>
<!-- I thought the following dependency would work but it didnt.. -->
<!--<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen-jakarta</artifactId>
<version>5.6.15.Final</version>
</dependency>-->
</dependencies>
</plugin>
With hibernate.properties
hibernate.connection.url=jdbc:mysql://someserver
hibernate.connection.username=username
hibernate.connection.password=password
hibernate.connection.driver_class=com.mysql.cj.jdbc.Driver
hibernate.dialect=org.hibernate.dialect.MySQLDialect
it works with hbernate-tools-maven. I use the latest version on maven central: 6.2.6.Final This is the definition of the plugin tag inside my pom.xml
hibernate.properties
hibernate.reveng.xml
my command line for generating entities classes: