Additional Resources and Hibernate Facet confusion
I am working on an hibernate project that loads mapping files outside of the .cfg.xml configuration, and as such was expecting a way for me to tell idea where to find the additional resource files to consider.
I was using 7.0.2 until 2 minutes ago, where there was an "add additional resource" function in the hibernate facet config, but this did not work (the additional resource disappeared as soon as I pressed "apply" or "ok" on the dialog.
So I moved to last EAP (7656) hoping this bug could be fixed and... the function is not there anymore and I now can add only hibernate configuration files to the hibernate facet.
Am I missing something?
Please sign in to leave a comment.
Hello Davide,
The action disappeared due to the fact that this feature is meaningless.
And in hibernate facet it has never been implemented correctly.
Resource files are copied to compile output folder automatically.
Regards,
Gregory Shrago
Davide Baroncelli wrote:
Hi Gregory, thanks for your answer. Does that mean that there is no way to explicitly tell IDEA which mapping files our project is loading (through programmatic ways that apprently idea does not detect)?
I was sort of guessing that that feature could allow one to tell the plugin that a particular mapping file is actually loaded by hibernate at runtime and as such has to be taken into consideration (we currently have all of our mapping files showing errors such as "class is not an entity" on all named queries because the mapping is not directly loaded by the .cfg.xml but is loaded programmatically at runtime).
Such a feature short of being meaningless would have been useful, or am I misunderstanding something in how the hibernate plugin works?
Thanks,
Davide.
Hello Davide,
The way to explicitly tell IDEA which mapping files to use is
to configure session factory.
You can duplicate the programmatic configuration in hibernate or spring
xml and this should solve the problem better.
Regards,
Gregory Shrago
Davide Baroncelli wrote:
Ok, not ideal but acceptable. Thanks.