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.
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.
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…
Thank you @reagan
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