/
DefaultCollectionTypeFactory.cs
59 lines (49 loc) · 1.76 KB
/
DefaultCollectionTypeFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System.Collections;
using System.Collections.Generic;
using NHibernate.Bytecode;
namespace NHibernate.Type
{
public class DefaultCollectionTypeFactory : ICollectionTypeFactory
{
public virtual CollectionType Array(string role, string propertyRef, System.Type elementClass)
{
return new ArrayType(role, propertyRef, elementClass);
}
public virtual CollectionType Bag<T>(string role, string propertyRef)
{
return new GenericBagType<T>(role, propertyRef);
}
public virtual CollectionType List<T>(string role, string propertyRef)
{
return new GenericListType<T>(role, propertyRef);
}
public virtual CollectionType IdBag<T>(string role, string propertyRef)
{
return new GenericIdentifierBagType<T>(role, propertyRef);
}
public virtual CollectionType Set<T>(string role, string propertyRef)
{
return new GenericSetType<T>(role, propertyRef);
}
public virtual CollectionType SortedSet<T>(string role, string propertyRef, IComparer<T> comparer)
{
return new GenericSortedSetType<T>(role, propertyRef, comparer);
}
public virtual CollectionType OrderedSet<T>(string role, string propertyRef)
{
return new GenericOrderedSetType<T>(role, propertyRef);
}
public virtual CollectionType Map<TKey, TValue>(string role, string propertyRef)
{
return new GenericMapType<TKey, TValue>(role, propertyRef);
}
public virtual CollectionType SortedDictionary<TKey, TValue>(string role, string propertyRef, IComparer<TKey> comparer)
{
return new GenericSortedDictionaryType<TKey, TValue>(role, propertyRef, comparer);
}
public virtual CollectionType SortedList<TKey, TValue>(string role, string propertyRef, IComparer<TKey> comparer)
{
return new GenericSortedListType<TKey, TValue>(role, propertyRef, comparer);
}
}
}