forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSchemaAutoAction.cs
86 lines (75 loc) · 1.62 KB
/
SchemaAutoAction.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
namespace NHibernate.Cfg
{
public class SchemaAutoAction
{
private readonly string value;
private SchemaAutoAction(string value)
{
this.value = value;
}
public override string ToString()
{
return value;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}
if (ReferenceEquals(this, obj))
{
return true;
}
if (obj.GetType() != typeof(SchemaAutoAction))
{
return false;
}
return Equals((SchemaAutoAction)obj);
}
public bool Equals(string other)
{
return value.Equals(other);
}
public bool Equals(SchemaAutoAction other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
return Equals(other.value, value);
}
public override int GetHashCode()
{
return (value != null ? value.GetHashCode() : 0);
}
public static bool operator ==(string a, SchemaAutoAction b)
{
if (ReferenceEquals(null, b))
{
return false;
}
return b.Equals(a);
}
public static bool operator ==(SchemaAutoAction a, string b)
{
return b == a;
}
public static bool operator !=(SchemaAutoAction a, string b)
{
return !(a == b);
}
public static bool operator !=(string a, SchemaAutoAction b)
{
return !(a == b);
}
public static SchemaAutoAction Recreate = new SchemaAutoAction("create-drop");
public static SchemaAutoAction Create = new SchemaAutoAction("create");
public static SchemaAutoAction Update = new SchemaAutoAction("update");
public static SchemaAutoAction Validate = new SchemaAutoAction("validate");
}
}