@@ -23,8 +23,6 @@ public class FromParser : IParser {
23
23
private bool expectingAs ;
24
24
private bool afterJoinType ;
25
25
private bool afterFetch ;
26
- //TODO: H2.0.3 does not have classPersister as a field...
27
- private ILoadable classPersister ;
28
26
private JoinType joinType = JoinType . None ;
29
27
30
28
private static IDictionary joinTypes = new Hashtable ( ) ;
@@ -119,11 +117,6 @@ public void Token(string token, QueryTranslator q) {
119
117
// _after_ the class name or path expression ie using the
120
118
// AS construction
121
119
122
- // if (classPersister!=null)
123
- // {
124
- // q.AddFromClass(token, classPersister);
125
- // }
126
- //else if (entityName!=null)
127
120
if ( entityName != null )
128
121
{
129
122
q . SetAliasName ( token , entityName ) ;
@@ -136,15 +129,14 @@ public void Token(string token, QueryTranslator q) {
136
129
expectingJoin = true ;
137
130
expectingAs = false ;
138
131
entityName = null ;
139
- classPersister = null ;
140
-
141
132
}
142
133
else if ( afterIn )
143
134
{
144
135
// process the "old" HQL style where aliases appear _first
145
136
// ie using the IN or IN CLASS constructions
146
137
147
138
if ( alias == null ) throw new QueryException ( "alias not specified for: " + token ) ;
139
+
148
140
if ( joinType != JoinType . None ) throw new QueryException ( "outer or full join must be followed by path expressions" ) ;
149
141
150
142
if ( afterClass )
@@ -180,7 +172,6 @@ public void Token(string token, QueryTranslator q) {
180
172
{
181
173
// starts with the name of a mapped class (new style)
182
174
if ( joinType != JoinType . None ) throw new QueryException ( "outer or full join must be followed by path expression" ) ;
183
- classPersister = p ;
184
175
entityName = q . CreateNameFor ( p . MappedClass ) ;
185
176
q . AddFromClass ( entityName , p ) ;
186
177
expectingAs = true ;
@@ -197,6 +188,7 @@ public void Token(string token, QueryTranslator q) {
197
188
// starts with a path expression (new style)
198
189
199
190
// force HQL style: from Person p inner join p.cars c
191
+ //if (joinType==JoinType.None) throw new QueryException("path expression must be preceded by full, left, right or inner join");
200
192
201
193
//allow ODMG OQL style: from Person p, p.cars c
202
194
if ( joinType != JoinType . None )
@@ -239,9 +231,9 @@ public void Token(string token, QueryTranslator q) {
239
231
}
240
232
}
241
233
242
- public virtual void Start ( QueryTranslator q ) {
234
+ public virtual void Start ( QueryTranslator q )
235
+ {
243
236
entityName = null ;
244
- classPersister = null ;
245
237
alias = null ;
246
238
afterIn = false ;
247
239
afterAs = false ;
@@ -252,7 +244,8 @@ public virtual void Start(QueryTranslator q) {
252
244
joinType = JoinType . None ;
253
245
}
254
246
255
- public virtual void End ( QueryTranslator q ) {
247
+ public virtual void End ( QueryTranslator q )
248
+ {
256
249
}
257
250
}
258
251
}
0 commit comments