-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathOuterJoinLoader.cs
122 lines (105 loc) · 2.98 KB
/
OuterJoinLoader.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System.Collections.Generic;
using NHibernate.Engine;
using NHibernate.Persister.Collection;
using NHibernate.Persister.Entity;
using NHibernate.SqlCommand;
using NHibernate.Type;
namespace NHibernate.Loader
{
/// <summary>
/// Implements logic for walking a tree of associated classes.
/// </summary>
/// <remarks>
/// Generates an SQL select string containing all properties of those classes.
/// Tables are joined using an ANSI-style left outer join.
/// </remarks>
public abstract class OuterJoinLoader : BasicLoader
{
// Having these fields as protected prevents CLS compliance, so they are
// private in NHibernate, and setters are created for the relevant
// properties.
private ILoadable[] persisters;
private ICollectionPersister[] collectionPersisters;
private int[] collectionOwners;
private string[] aliases;
private LockMode[] lockModeArray;
private int[] owners;
private EntityType[] ownerAssociationTypes;
private SqlString sql;
private string[] suffixes;
private string[] collectionSuffixes;
private bool[] entityEagerPropertyFetches;
private readonly IDictionary<string, IFilter> enabledFilters;
protected OuterJoinLoader(ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(factory)
{
this.enabledFilters = enabledFilters;
}
protected Dialect.Dialect Dialect
{
get { return Factory.Dialect; }
}
protected override int[] Owners
{
get { return owners; }
}
protected override EntityType[] OwnerAssociationTypes
{
get { return ownerAssociationTypes; }
}
public IDictionary<string, IFilter> EnabledFilters
{
get { return enabledFilters; }
}
protected override int[] CollectionOwners
{
get { return collectionOwners; }
}
protected override string[] Suffixes
{
get { return suffixes; }
}
protected override string[] CollectionSuffixes
{
get { return collectionSuffixes; }
}
public override SqlString SqlString
{
get { return sql; }
}
public override ILoadable[] EntityPersisters
{
get { return persisters; }
}
public override LockMode[] GetLockModes(IDictionary<string, LockMode> lockModes)
{
return lockModeArray;
}
protected override string[] Aliases
{
get { return aliases; }
}
protected internal override ICollectionPersister[] CollectionPersisters
{
get { return collectionPersisters; }
}
protected override bool[] EntityEagerPropertyFetches
{
get { return entityEagerPropertyFetches; }
}
protected void InitFromWalker(JoinWalker walker)
{
persisters = walker.Persisters;
collectionPersisters = walker.CollectionPersisters;
ownerAssociationTypes = walker.OwnerAssociationTypes;
lockModeArray = walker.LockModeArray;
suffixes = walker.Suffixes;
collectionSuffixes = walker.CollectionSuffixes;
owners = walker.Owners;
collectionOwners = walker.CollectionOwners;
sql = walker.SqlString;
aliases = walker.Aliases;
entityEagerPropertyFetches = walker.EagerPropertyFetches;
}
}
}