Quote:
I would guess that it got rejected because you are suggesting that Hibernate impose a different type of requirement on users. Sure currently they need to have commons collections on the classpath, but your suggestion is that the would need to utilize commons collections specific classes for certain Hibernate functionality
I'm not actually suggesting anything that would impose on users. If they want their <bag> mappings to be a java List in their class, as they do now, they would leave their classes with a List. If they want it mapped to an apache Bag, they could use a Bag in their class.
Quote:
And I'm saying you can acheive this in Hibernate already without touching a single line of Hibernate code. Simply expose the collection in your getters and setters as java.util.List (or even java.lang.Collection if you wish) and then map it as a bag
I know that currently I can map a Hibernate bag to a Java List. I want to be able to map a hibernate bag to a Java/Apache Bag, because I find the semantics of the Apache bag interface useful, and a more suitable mapping than a List when you don't actually want a List. I could use the List interface in my class and then wrap it inside of a HashBag/TreeBag, but that would require a costly conversion, and would prevent the use of collection proxies.
Hmm... I think I see the communications problem here. For some reason, I was under the impression that Hibernate created collection instances of different classes depending on the results of reflection on the class, as looked up at mapping time. A closer look at the documentation shows that that's not so and, for example, a <set> mapping will always give you a net.sf.hibernate.collection.Set instance. I guess this should have seemed obvious, but for some reason I didn't see it, and I imagined a more complex implementation where it would be possible to customize which concrete class of the collection was created.