GMEFil
GMEFil

Reputation: 137

Configure Hibernate mapping in JHipster project

I have a basic JHipster project and I want to configure hibernate mapping.

How do I add this file?

Upvotes: 4

Views: 816

Answers (1)

Michael Cornel
Michael Cornel

Reputation: 4004

I guess this question is somewhat outdated. Some thoughts anyway:

  1. JHipster templates are built to work without Hibernate mapping files. JPA is configured to read the mapping out of annotated Entity files. You can look at your generated entity files or at the acoording template. You may also want to look at this SO Question.

  2. If you want to use ONLY mapping files for some reason, you should be able to do so without any issue. Just add them like you would in a non-JHipster project. The bigger problem is that you should modify all generated entities to remove the annotations to avoid confusion.

  3. You can also mix annotations and XML: "When you use both approaches within the same project, the mapping definitions defined by the annotations and in the orm.xml are used together. The XML configuration overrides the annotations if you define the same mapping via annotations and in the orm.xml file." (Source: Blog)

Upvotes: 1

Related Questions