forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjectNotFoundException.cs
79 lines (70 loc) · 1.82 KB
/
ObjectNotFoundException.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
using System;
using System.Runtime.Serialization;
namespace NHibernate
{
/// <summary>
/// Thrown when the user tries to pass a deleted object to the <c>ISession</c>.
/// </summary>
[Serializable]
public class ObjectNotFoundException : HibernateException
{
private object identifier;
private System.Type type;
/// <summary>
///
/// </summary>
/// <param name="message"></param>
/// <param name="identifier"></param>
/// <param name="type"></param>
public ObjectNotFoundException( string message, object identifier, System.Type type ) : base( message )
{
this.identifier = identifier;
this.type = type;
}
/// <summary></summary>
public object Identifier
{
get { return identifier; }
}
/// <summary></summary>
public override string Message
{
get { return base.Message + ": " + identifier + ", of class: " + type.FullName; }
}
/// <summary></summary>
public System.Type Type
{
get { return type; }
}
/// <summary>
///
/// </summary>
/// <param name="message"></param>
/// <param name="root"></param>
public ObjectNotFoundException( string message, Exception root ) : this( message, root.Message, typeof( ObjectNotFoundException ) )
{
}
/// <summary>
///
/// </summary>
/// <param name="message"></param>
public ObjectNotFoundException( string message ) : this( message, message, typeof( ObjectNotFoundException ) )
{
}
/// <summary>
///
/// </summary>
/// <param name="root"></param>
public ObjectNotFoundException( Exception root ) : this( root.Message, root.Message, typeof( ObjectNotFoundException ) )
{
}
/// <summary>
///
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected ObjectNotFoundException( SerializationInfo info, StreamingContext context ) : base( info, context )
{
}
}
}