I tried mapping an object which has a java.lang.Object attribute as a joined-subclass. That part of my hbm.xml file is something like this:
...
<joined-subclass name="MySubclass" table="mysubclass_table">
<key column="subclass"/>
<property name="objectValue" type="java.lang.Object"/>
</joined-subclass>
...
where I also tried using type = "object".
The mapping also includes other joined-subclasses, but I can't get it to work with any of those types. I can do code and schema generation (which work fine), but when I try to get a sessionFactory from this Configuration I get:
java.lang.ArrayIndexOutOfBoundsException: 1
at net.sf.hibernate.util.ArrayHelper.slice(ArrayHelper.java:59)
at net.sf.hibernate.loader.OuterJoinLoader.walkComponentTree(OuterJoinLoader.java:230)
at net.sf.hibernate.loader.OuterJoinLoader.walkClassTree(OuterJoinLoader.java:191)
at net.sf.hibernate.loader.OuterJoinLoader.walkTree(OuterJoinLoader.java:74)
at net.sf.hibernate.loader.OneToManyLoader.(OneToManyLoader.java:57)
at net.sf.hibernate.collection.CollectionPersister.createCollectionQuery(CollectionPersister.java:277)
at net.sf.hibernate.collection.CollectionPersister.(CollectionPersister.java:268)
at net.sf.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:216)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
...
Other types work fine with this subclass and others. Please tell me if there is a way to map this kind of type or I should use some other.
Thanks a lot for your help once again.
|