forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathList.cs
51 lines (45 loc) · 1.13 KB
/
List.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
using System;
using NHibernate.Type;
namespace NHibernate.Mapping
{
/// <summary>
/// A list has a primary key consisting of the key columns + index column
/// </summary>
[Serializable]
public class List : IndexedCollection
{
private int baseIndex;
/// <summary>
/// Initializes a new instance of the <see cref="List"/> class.
/// </summary>
/// <param name="owner">The <see cref="PersistentClass"/> that contains this list mapping.</param>
public List(PersistentClass owner) : base(owner)
{
}
/// <summary>
/// Gets the appropriate <see cref="CollectionType"/> that is
/// specialized for this list mapping.
/// </summary>
public override CollectionType DefaultCollectionType
{
get
{
if (IsGeneric)
{
CheckGenericArgumentsLength(1);
return TypeFactory.GenericList(Role, ReferencedPropertyName, GenericArguments[0]);
}
throw new MappingException("Non-generic persistent lists are not supported (role " + Role +").");
}
}
public int BaseIndex
{
get { return baseIndex; }
set { baseIndex = value; }
}
public override bool IsList
{
get { return true; }
}
}
}