Object-relational mapping (JPA + Hibernate) using XML

4

For a specific reason, I need to map object-relational (JPA) of my entities with XML. [Unfortunately,] I can not use annotations to do this. It turns out that on certain properties I need to use Hibernate-specific features. For example, extra lazy collections, something I would easily do using annotations with @LazyCollection (LazyCollectionOption.Extra).

The JPA Hibernate documentation reads as follows:

  

"If you wish to use Hibernate specific features in some entities, you 'll have to either use annotations or fallback to hbm files. ( link )

It turns out that I have no idea how to use the aforementioned "hbm files" along with my orm.xml (if that's what I should do).

Does anyone know how to do this?

    
asked by anonymous 09.07.2014 / 03:09

1 answer

2

Dude, as I recall, are just specific nomenclatures of the files that hibernate used for mapping ... So in your case for example: orm.hbn.xml which is still your orm.xml where you defines all mapping of entities.

Just pay attention to setting priority, your xml file will override settings by throwing annotations.

    
09.07.2014 / 20:34