forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDependantValue.cs
50 lines (42 loc) · 1006 Bytes
/
DependantValue.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
using System;
using NHibernate.Type;
namespace NHibernate.Mapping
{
/// <summary>
/// A value which is "typed" by reference to some other value
/// (for example, a foreign key is typed by the referenced primary key).
/// </summary>
[Serializable]
public class DependantValue : SimpleValue
{
private readonly IKeyValue wrappedValue;
private bool isNullable = true;
private bool isUpdateable = true;
public DependantValue(Table table, IKeyValue prototype)
: base(table)
{
wrappedValue = prototype;
}
public override IType Type
{
get { return wrappedValue.Type; }
}
public void SetTypeUsingReflection(string className, string propertyName) { }
public override bool IsNullable
{
get { return isNullable; }
}
public void SetNullable(bool nullable)
{
isNullable = nullable;
}
public override bool IsUpdateable
{
get { return isUpdateable; }
}
public virtual void SetUpdateable(bool updateable)
{
isUpdateable = updateable;
}
}
}