Problem with hibernate configuration location

Hi all, I have a somewhat complicated project configuration resulting from my company using a custom plugin for generating the project structure. This makes my problem a bit awkward to diagnose/describe and solve, but I'll give it a try.

So, in my project I'm using a hibernate facet. The facet config specifies that my configuration is in
/usr/local/g/home/baroncelli/workspaces/pat/g3/ge/psopat/resource/confdev/pso_pat.hibernate.cfg.xml
The "confdev" directory is actually a symlink pointing to ../../../b-genfiles/ge/psopat/resource/confdev/ , I don't know if this is related or not, though.

That file, includes this link to the mappings configuration:
<mapping resource="ge/psopat/resource/Psopat.hbm.xml"/>

The path is relative to the same classpath root as the .cfg.xml file, and they are in the same module (although the .hbm.xml is not symlinked as the other one is).
This is the form that the link must have for this to work *at runtime*: that is when I launch my project from inside IDEA, if the link has this form, hibernate finds the file and everything works.

Nevertheless, this *does not work in IDEA*, that is for the hibernate support to actually follow the link and use its info for providing autocompletion, etc. In fact, in that form the link is red (as in "error" ).
In order for IDEA's hibernate integration to work, I have to change the link to:
<mapping resource="../ge/psopat/resource/Psopat.hbm.xml"/>
If I do this, all autocompletions/validations/etc. features work... but my run/debug configuration fails at startup. Isn't this weird? (and annoying!)

Is there anything I can do to diagnose the cause of this?

Please sign in to leave a comment.