Hibernate Metamodel Generator not working

I tried to enable metamodel generator. To do so, I followed instructions here:
https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#tooling-modelgen
and https://hibernate.org/orm/tooling/.

I created a demo spring boot project and it worked there.
Then I did the same in the jmix project, but it just ignored these settings.

All I did is I have added the following lines to build.gradle:

plugins {
    id("org.hibernate.orm") version "6.3.0.CR1"
}

dependencies {
    // https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-jpamodelgen
    annotationProcessor 'org.hibernate.orm:hibernate-jpamodelgen:6.2.5.Final'
}

Hello,

Jmix is a high-level framework on top of Spring Boot and it uses EclipseLink for the ORM needs, not Hibernate.
EclipseLink is an implementation of JPA same as Hibernate and most likely can do everything you need. https://www.baeldung.com/jpa-hibernate-difference

Using Hibernate somehow with Jmix mostly defeats the purpose of Jmix. Do you have a specific need for Hibernate?

Kind regards,
Mladen

Hi, Mladen. Thank for your response.
No, there is no specific need for Hibernate. Anything that works is fine for me.

Last couple of days I have been trying to include it into my project. But I did not succeed. For now, I am writing these manually. Have you got any example project for me to have a reference? If you shared a link, I would be really appreciated.

Hi, sorry I don’t have any examples for you, I don’t use or plan to use Hibernate with Jmix.
EclipseLink originates from Oracle’s TopLink when they gave it to the Eclipse Foundation to open source it, and is considered to have more features than Hibernate which was open source from the start.
In your place, I would try to find equivalent functionalities in EclipseLink.

Kind regards,
Mladen

1 Like