# Converting hbm.xml to orm.xml

**URL:** <https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912>\
**Category:** Hibernate ORM\
**Created:** [January 26, 2024, 1:19am UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912 "2024-01-26T01:19:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasim\_Tukhi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/nasim_tukhi/32/2966_2.png) [@Nasim\_Tukhi](https://discourse.hibernate.org/u/Nasim_Tukhi)\
**Post date:** [January 26, 2024, 1:19am UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/1 "2024-01-26T01:19:43Z")

</div>

I have a relatively large hbm.xml file that I want to convert to orm.xml since hbm.xml will be deprecated in the near future. Any advise?

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [January 26, 2024, 10:59am UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/2 "2024-01-26T10:59:15Z")

</div>

Use the output of the [hbm.xml transformer](https://docs.jboss.org/hibernate/orm/6.4/javadocs/org/hibernate/cfg/MappingSettings.html#TRANSFORM_HBM_XML) as basis and fill in the gaps. There is also a gradle task (`org.hibernate.orm.tooling.gradle.misc.TransformHbmXmlTask`) that you can use to invoke the transformer: [Gradle - Plugin: org.hibernate.orm](https://plugins.gradle.org/plugin/org.hibernate.orm)

---

<div class="post-metadata">

**Author:** ![Nasim\_Tukhi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/nasim_tukhi/32/2966_2.png) [@Nasim\_Tukhi](https://discourse.hibernate.org/u/Nasim_Tukhi)\
**Post date:** [March 4, 2024, 4:44pm UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/3 "2024-03-04T16:44:30Z")

</div>

I should specify that I am using Maven and not Gradle.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 5, 2024, 8:11am UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/4 "2024-03-05T08:11:14Z")

</div>

Then use the hibernate-core built-in auto transformation to obtain the orm.xml.

---

<div class="post-metadata">

**Author:** ![Samuel\_Machauer](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/samuel_machauer/32/3340_2.png) [@Samuel\_Machauer](https://discourse.hibernate.org/u/Samuel_Machauer)\
**Post date:** [July 8, 2024, 10:10am UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/5 "2024-07-08T10:10:25Z")

</div>

Hello, where can I get the output from the HBM XML transformer?

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [July 8, 2024, 3:14pm UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/6 "2024-07-08T15:14:27Z")

</div>

See the README on the [GitHub repository](https://github.com/hibernate/hibernate-orm/tree/main/tooling/hibernate-gradle-plugin).

---

<div class="post-metadata">

**Author:** ![dinaadams](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/dinaadams/32/3342_2.png) [@dinaadams](https://discourse.hibernate.org/u/dinaadams)\
**Post date:** [July 9, 2024, 10:48am UTC](https://discourse.hibernate.org/t/converting-hbm-xml-to-orm-xml/8912/7 "2024-07-09T10:48:24Z")

</div>

Hello,  
As per me to convert your large hbm.xml file to orm.xml, start by mapping your Hibernate-specific tags to their JPA equivalents and ensure all entity mappings are correctly annotated. Validate the conversion by thoroughly testing your application.
