You should be able to specify the type of the collection that Hibernate will use in the mapping.
Check out the documentation - it provides xml mapping samples, quote:
Apart from the tag as shown in Example 7.4, “Mapping a Set using
”, there is also list, map, bag, array and
primitive-array mapping elements.
Also, check out Hibernate - Bag Mappings
For example in Fluent NHibernate you can use .AsBag()
and .AsSet()
extension methods on a mapping to indicate if you want a bag semantics, i.e. unordered
sequence with duplicates.
See this blog post and this blog post for an example of using this in NHibernate
In essence, your fluent mapping could look something like this
public YourClassMap : ClassMap<YourClass>
{
public YourClassMap()
{
HasMany<double>(x => x.doubles)
.AsBag()
.Access.CamelCaseField();
...
Your xml mapping would look something like this
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="YourNamespace" assembly="YourAssembly">
<class name="YourClass" table="YourTableName">
...
<bag name="doubles" table="Doubles">
<one-to-many class="Double"/>
</bag>
Sorry for providing examples only for NHibernate, this is what I work with daily, you should be able to fairly easily apply this in Hibernate as well