forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapProxyFactory.cs
45 lines (39 loc) · 1.14 KB
/
MapProxyFactory.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
using System;
using System.Collections.Generic;
using System.Reflection;
using NHibernate.Engine;
using NHibernate.Type;
namespace NHibernate.Proxy.Map
{
public class MapProxyFactory : IProxyFactory
{
//6.0 TODO: make readonly
private string entityName;
//Since v5.3
[Obsolete("Please use constructor accepting entityName instead.")]
public MapProxyFactory()
{
}
public MapProxyFactory(string entityName)
{
this.entityName = entityName;
}
//Since v5.3
[Obsolete("Please use constructor accepting entityName instead.")]
public void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces,
MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod,
IAbstractComponentType componentIdType)
{
//6.0 TODO: throw NotSupportedException in the new override
this.entityName = entityName;
}
public INHibernateProxy GetProxy(object id, ISessionImplementor session)
{
return new MapProxy(new MapLazyInitializer(entityName, id, session));
}
public object GetFieldInterceptionProxy(object getInstance)
{
throw new NotSupportedException();
}
}
}