Can't locate the Hibernate ORM File or It does not exist when trying to customize a module newly added

Is there anyone who created a module and can not locate the Hibernate ORM File after creating the module ? I am reading the devmanual but I can not see .hbm.xml file to update after creating a module. Thank you for any kind of help.

1 Like

Hibernate is a built in framework in both openmrs reference app and distribution, if you are creating a module from scratch as in using the command line, hibernate is considered too, even when you are going to modify a module, For your case, you may not see hibernate class to modify but when you try to create another class that uses hibernate configurations, Any IDE you are using will not show any error irrespective all configurations and settings are cleary configured.

1 Like

@pcp have you had a look at this and that in regards to your issue

1 Like

Ok. I will take look. Thanks @sharif, @gcliff

It will be good to also get a bit of acquaintance with liquibase and how it works…otherwise by default the module archetype doesn’t come with hibernate preset…so add it in the pom(dependencies) and then u can define the different needs of ur module…what’s most important is following the conventions of modular design for openmrs…

1 Like

Thank you @reagan

1 Like

Dear team,

Am also in the same dilemma. I can’t locate the .hbm.xml file from my module.

By default your first module automatically connects to your database…If you want to connect at another database then dats when u create hbm.xml file

Generally speaking, it’s best if modules do their Hibernate mappings via annotations anyways (e.g., as is done in the FHIR2 module), but if you really want to use a hbm.xml file, you can create it in src/main/resources, e.g. src/main/resources/MyGreatClass.hbm.xml and then add it to the config.xml as mapping file as shown here.

It isn’t generally add from the module template because a module might have more than one domain class or even none at all.

Thanks @ibacher

Thanks @jonathan