Idan
Idan

Reputation: 951

one mapping folder for all hibernate hbm.xml files

if have all my hbm.xml files in one folder

and i try to make my hibernate.cfg.xml

to find then in this folder (with no adding one by one hbm.xml resource) so i add:

<mapping resource="*.hbm.xml"/>

but he trow:

failed.org.hibernate.MappingNotFoundException: resource: *.hbm.xml not found

but if i put

<mapping resource="testobj.hbm.xml"/>

it work just fine..

way?

thanks in advance.

Upvotes: 0

Views: 1410

Answers (1)

Ken Chan
Ken Chan

Reputation: 90567

If you use JPA with hibernate as the implementation , you can configure the property hibernate.archive.autodetection to hbm to enable auto discovery of the hbm.xml files.

Check this.

Upvotes: 1

Related Questions