forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmptyInterceptor.cs
106 lines (86 loc) · 2.22 KB
/
EmptyInterceptor.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections;
using NHibernate.SqlCommand;
using NHibernate.Type;
namespace NHibernate
{
/// <summary>
/// An interceptor that does nothing. May be used as a base class for application-defined custom interceptors.
/// </summary>
[Serializable]
public class EmptyInterceptor : IInterceptor
{
/// <summary>
/// The singleton reference.
/// </summary>
public static readonly EmptyInterceptor Instance = new EmptyInterceptor();
public virtual void OnDelete(object entity, object id, object[] state, string[] propertyNames, IType[] types)
{
}
public virtual void OnCollectionRecreate(object collection, object key)
{
}
public virtual void OnCollectionRemove(object collection, object key)
{
}
public virtual void OnCollectionUpdate(object collection, object key)
{
}
public virtual bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState,
string[] propertyNames, IType[] types)
{
return false;
}
public virtual bool OnLoad(object entity, object id, object[] state, string[] propertyNames, IType[] types)
{
return false;
}
public virtual bool OnSave(object entity, object id, object[] state, string[] propertyNames, IType[] types)
{
return false;
}
public virtual void PostFlush(ICollection entities)
{
}
public virtual void PreFlush(ICollection entitites)
{
}
public virtual bool? IsTransient(object entity)
{
return null;
}
public virtual object Instantiate(string clazz, object id)
{
return null;
}
public virtual string GetEntityName(object entity)
{
return null;
}
public virtual object GetEntity(string entityName, object id)
{
return null;
}
public virtual int[] FindDirty(object entity, object id, object[] currentState, object[] previousState,
string[] propertyNames, IType[] types)
{
return null;
}
public virtual void AfterTransactionBegin(ITransaction tx)
{
}
public virtual void BeforeTransactionCompletion(ITransaction tx)
{
}
public virtual void AfterTransactionCompletion(ITransaction tx)
{
}
public virtual void SetSession(ISession session)
{
}
public virtual SqlString OnPrepareStatement(SqlString sql)
{
return sql;
}
}
}