I am using Jibx with Hibernate.
Now i have a Model which has a property of type java.util.Set. Now there are two scenario's in which this set would be initalised. one where Hibernate loads it in which case the instance would be org.hibernate.PersistentSet and in another case i would load the set in which case the instance would be java.util.HashSet.
Now the problem is when i define the Mapping i give the
<collection field="csu" type="java.util.HashSet"/>
Now when i marshall the data from hibernate i get a classcastexception.
I expect this Hashset to be used only in the case of unmarshalling where a new instance for that property has to be created.
Since other wise all marshalling operation can happen against the Interface itself.
But it is not happening so. The type is being used for both unmarshalling/marshalling . what i would prefer is a scenario where the declared type of the property is used for marshalling and the type specified for the collection tag used for creating the new instance's only.