Workaround for Issue with @Any Mapping in Hibernate Tools Plugin
There is a slight problem with 3.2.3.GA release of Hibernate Tools when specifically dealing with the @Any (or the <any> element if you are using xml to configure hibernate) type of relationship. The problem manifests itself with an exception that contains the message "org.hibernate.MappingException: property mapping has wrong number of columns" when you try to open the session factory in Eclipse.
I've found a work-around to this problem by updating some of the hibernate jars in the base plugin for Hibernate tools in eclipse.
(In the instructions below, replace <eclipse-home> with the location that you've installed Eclipse. Also, the direction of the slashes may be different for you depending on what platform you are on.)
I've found a work-around to this problem by updating some of the hibernate jars in the base plugin for Hibernate tools in eclipse.
(In the instructions below, replace <eclipse-home> with the location that you've installed Eclipse. Also, the direction of the slashes may be different for you depending on what platform you are on.)
- First, stop Eclipse.
- Next grab the hibernate-3.2.6.ga.jar and put it at <eclipse-home>\plugins\org.hibernate.eclipse_3.2.3.GA\lib\hibernate\hibernate3.jar
- Grab hibernate-annotations-3.3.1.GA.jar and put at <eclipse-home>\plugins\org.hibernate.eclipse_3.2.3.GA\lib\annotations\hibernate-annotations.jar
- Grab hibernate-commons-annotations-3.3.0.ga.jar and put at <eclipse-home>\plugins\org.hibernate.eclipse_3.2.3.GA\lib\annotations\hibernate-commons-annotations.jar
- Restart eclipse and try to use your project with the @Any mapping again.
Comments