forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBag.cs
43 lines (40 loc) · 1005 Bytes
/
Bag.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
using System;
using NHibernate.Type;
namespace NHibernate.Mapping
{
/// <summary>
/// A bag permits duplicates, so it has no primary key
/// </summary>
[Serializable]
public class Bag : Collection
{
/// <summary>
/// A bag permits duplicates, so it has no primary key.
/// </summary>
/// <param name="owner">The <see cref="PersistentClass"/> that contains this bag mapping.</param>
public Bag(PersistentClass owner) : base(owner)
{
}
/// <summary>
/// Gets the appropriate <see cref="CollectionType"/> that is
/// specialized for this bag mapping.
/// </summary>
public override CollectionType DefaultCollectionType
{
get
{
System.Type elementType = typeof (object);
if (IsGeneric)
{
CheckGenericArgumentsLength(1);
elementType = GenericArguments[0];
}
return TypeFactory.GenericBag(Role, ReferencedPropertyName, elementType);
}
}
public override void CreatePrimaryKey()
{
//create an index on the key columns??
}
}
}