Up to Hibernate 5 the class mapping can be defined either by using JPA annotations or with an XML file. The XML file is convenient because it isn't tied to the class, which means it's possible to:
- map a class even if you don't have the source code
- map a class differently depending on the context (a class may be mapped one way on the server, and another way on the client)
Hibernate 6 removed the XML mapping. Is there an alternative method to define a mapping without adding annotations to the persisted classes?
We now recommend the use of the standard JPA ORM mapping format, which is
orm.xml.For Hibernate-specific extensions to the
orm.xmlformat you can findmapping-3.1.0.xsdhere:https://hibernate.org/xsd/orm/mapping/mapping-3.1.0.xsd
I guess this is what you're looking for.