How to remove/hide unnecessary Session Factories (picked up from a dependent JAR file) from the Persistence view?

Greetings!


After adding Hibernate Facet to an existing module with Spring configuration, I found unexpected Session Factories shown in the Persistence view. Half of the factories belong to the current module (i.e. they are defined in the current module's Spring config XML), another part is picked up from the Spring configuration of a dependent JAR. Need to note, that session factories of the current module extend (i.e. use as a "parent") abstract factories from the dependent JAR. In addition, dependent JAR has multiple non-abstract factories definition as well. I think this causes IDEA to display both set of factories...

How I can add a filter to the searched Session Factory locations or remove not needed factories from the Persistent view? In my case IDEA doesn't allow me to remove "top-level" factories, because config file is located in the "external" JAR file. I reviewed "Spring Application Context" module's configuration, i.e. click "Edit" and make sure that dependent JAR is NOT selected. If it is not a bug, IMO the described behavior is confusing (I would allow to customize/filter displayed list of entities at least).

BTW, found old post that describes similar confguration (see post from Thibaut): http://devnet.jetbrains.com/message/5271516#5271516.


Thanks for assistence,
Dmitry

2 comments

Update: I have been trying to workaround this behavior in different ways, i.e. remove/add Spring config XMLs of the dependent JAR to the module's Spring Application Context, remove/add non-abstract factories declaration in the Spring XML of the denendent JAR file "on the fly", remove/add Hibernate facet from/to the module between attemps. After all, I've restarted IDEA and now ... it does NOT show Session Factories from the dependent JAR! I know it sounds weird, but it is what it is... :^O

I still think there is some floating bug in this area, but I am settled now, so resloving my question.

0

Update#2: I needed to reimport the module, and faced this problem again :^O Second time I was not able to "workaround" it, so created http://youtrack.jetbrains.com/issue/IDEA-114420.

0

Please sign in to leave a comment.