From: <fab...@us...> - 2009-04-30 23:41:34
|
Revision: 4219 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4219&view=rev Author: fabiomaulo Date: 2009-04-30 23:40:57 +0000 (Thu, 30 Apr 2009) Log Message: ----------- Removing compilation Warnings about CLS compliant and some other about Equals+GetHashCode Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlLexer.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlToken.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IErrorReporter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IParseErrorHandler.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Loader/QueryLoader.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QuerySyntaxException.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SessionFactoryHelperExtensions.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTTreeAdaptor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractNullnessCheckNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractRestrictableStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractSelectExpression.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BetweenOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryArithmeticOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BooleanLiteralNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/Case2Node.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CaseNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CollectionFunction.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ConstructorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DeleteStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DotNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementType.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromReferenceNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerTreeAdapter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerTreeNodeStream.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlTreeAdapter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IASTFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IASTNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IBinaryOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IResolvableNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IRestrictableStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ISelectExpression.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IUnaryOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IdentNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ImpliedFromElement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/InLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IndexNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IntoClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IsNotNullLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IsNullLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/JavaConstantNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/LiteralNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/MethodNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/OrderByClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ParameterNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/QueryNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SelectClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SelectExpressionImpl.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SelectExpressionList.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SqlFragment.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SqlNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/UnaryArithmeticNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/UnaryLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTAppender.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTIterator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTUtil.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/CollectingNodeVisitor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ColumnHelper.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/IVisitationStrategy.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/JoinProcessor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/NodeTraverser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/PathHelper.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/SyntheticAndFactory.cs trunk/nhibernate/src/NHibernate/LockMode.cs trunk/nhibernate/src/NHibernate/Type/ForeignKeyDirection.cs Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -7,6 +7,7 @@ /// Look ahead for tokenizing is all lowercase, whereas the original case of an input stream is preserved. /// Copied from http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782 ///</summary> + [CLSCompliant(false)] public class CaseInsensitiveStringStream : ANTLRStringStream { public CaseInsensitiveStringStream(char[] data, int numberOfActualCharsInArray) : base(data, numberOfActualCharsInArray) { } Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Text; using Antlr.Runtime; using log4net; @@ -8,6 +9,7 @@ /// <summary> /// An error handler that counts parsing errors and warnings. /// </summary> + [CLSCompliant(false)] public class ErrorCounter : IParseErrorHandler { private static readonly ILog log = LogManager.GetLogger(typeof(ErrorCounter)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/AbstractStatementExecutor.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,3 +1,4 @@ +using System; using NHibernate.Engine; using NHibernate.SqlCommand; using log4net; @@ -4,6 +5,7 @@ namespace NHibernate.Hql.Ast.ANTLR.Exec { + [CLSCompliant(false)] public abstract class AbstractStatementExecutor : IStatementExecutor { private readonly ILog log; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Exec/BasicExecutor.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -12,6 +12,7 @@ namespace NHibernate.Hql.Ast.ANTLR.Exec { + [CLSCompliant(false)] public class BasicExecutor : AbstractStatementExecutor { private readonly IQueryable persister; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlLexer.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlLexer.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,22 +1,21 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; namespace NHibernate.Hql.Ast.ANTLR { - public partial class HqlLexer - { - public override IToken Emit() - { - HqlToken t = new HqlToken(input, - state.type, - state.channel, - state.tokenStartCharIndex, - CharIndex - 1); + [CLSCompliant(false)] + public partial class HqlLexer + { + public override IToken Emit() + { + var t = new HqlToken(input, + state.type, + state.channel, + state.tokenStartCharIndex, + CharIndex - 1) {Line = state.tokenStartLine, Text = state.text}; - t.Line = state.tokenStartLine; - t.Text = state.text; - - Emit(t); - return t; - } - } + Emit(t); + return t; + } + } } Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -7,6 +7,7 @@ namespace NHibernate.Hql.Ast.ANTLR { + [CLSCompliant(false)] public partial class HqlParser { private static readonly ILog log = LogManager.GetLogger(typeof(HqlParser)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -14,6 +14,7 @@ namespace NHibernate.Hql.Ast.ANTLR { + [CLSCompliant(false)] public partial class HqlSqlWalker { private static readonly ILog log = LogManager.GetLogger(typeof(HqlSqlWalker)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlToken.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlToken.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlToken.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,11 +1,13 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; namespace NHibernate.Hql.Ast.ANTLR { /// <summary> /// A custom token class for the HQL grammar. /// </summary> - public class HqlToken : CommonToken + [CLSCompliant(false)] + public class HqlToken : CommonToken { /// <summary> /// The previous token type. Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IErrorReporter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IErrorReporter.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IErrorReporter.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,4 +1,5 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; namespace NHibernate.Hql.Ast.ANTLR { @@ -7,6 +8,7 @@ /// Author: josh /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public interface IErrorReporter { void ReportError(RecognitionException e); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IParseErrorHandler.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IParseErrorHandler.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IParseErrorHandler.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,10 +1,13 @@ -namespace NHibernate.Hql.Ast.ANTLR +using System; + +namespace NHibernate.Hql.Ast.ANTLR { /// <summary> /// Defines the behavior of an error handler for the HQL parsers. /// Author: josh /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public interface IParseErrorHandler : IErrorReporter { int GetErrorCount(); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Loader/QueryLoader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Loader/QueryLoader.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Loader/QueryLoader.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -19,6 +19,7 @@ namespace NHibernate.Hql.Ast.ANTLR.Loader { + [CLSCompliant(false)] public class QueryLoader : BasicLoader { private readonly QueryTranslatorImpl _queryTranslator; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QuerySyntaxException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QuerySyntaxException.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QuerySyntaxException.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,7 +1,9 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; namespace NHibernate.Hql.Ast.ANTLR { + [CLSCompliant(false)] public class QuerySyntaxException : QueryException { public QuerySyntaxException(string message) : base(message) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -18,6 +18,7 @@ namespace NHibernate.Hql.Ast.ANTLR { + [CLSCompliant(false)] public class QueryTranslatorImpl : IFilterTranslator { private static readonly ILog log = LogManager.GetLogger(typeof(QueryTranslatorImpl)); @@ -464,6 +465,7 @@ } } + [CLSCompliant(false)] public class HqlParseEngine { private static readonly ILog log = LogManager.GetLogger(typeof(HqlParseEngine)); @@ -579,6 +581,7 @@ } } + [CLSCompliant(false)] public class HqlSqlTranslator { private readonly IASTNode _inputAst; @@ -636,6 +639,7 @@ } } + [CLSCompliant(false)] public class HqlSqlGenerator { private static readonly ILog log = LogManager.GetLogger(typeof(HqlSqlGenerator)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SessionFactoryHelperExtensions.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SessionFactoryHelperExtensions.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SessionFactoryHelperExtensions.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -14,6 +14,7 @@ namespace NHibernate.Hql.Ast.ANTLR { + [CLSCompliant(false)] public class SessionFactoryHelperExtensions { private readonly ISessionFactoryImplementor _sfi; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -17,6 +17,7 @@ /// Author: Joshua Davis, Steve Ebersole /// Ported By: Steve Strong /// </summary> + [CLSCompliant(false)] public partial class SqlGenerator : IErrorReporter { /// <summary> Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTFactory.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTFactory.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,7 +1,9 @@ -using Antlr.Runtime.Tree; +using System; +using Antlr.Runtime.Tree; namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public class ASTFactory : IASTFactory { private readonly ITreeAdaptor _adaptor; @@ -11,13 +13,17 @@ _adaptor = adaptor; } + #region IASTFactory Members + public IASTNode CreateNode(int type, string text, params IASTNode[] children) { - IASTNode parent = (IASTNode)_adaptor.Create(type, text); + var parent = (IASTNode) _adaptor.Create(type, text); parent.AddChildren(children); return parent; } + + #endregion } -} +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -7,6 +7,7 @@ namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public class ASTNode : IASTNode, ITree { private int _startIndex; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTTreeAdaptor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTTreeAdaptor.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTTreeAdaptor.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,8 +1,10 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; using Antlr.Runtime.Tree; namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public class ASTTreeAdaptor : BaseTreeAdaptor { public override object DupNode(object t) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractNullnessCheckNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractNullnessCheckNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractNullnessCheckNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -13,6 +13,7 @@ /// Author: Steve Ebersole /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public abstract class AbstractNullnessCheckNode : UnaryLogicOperatorNode { protected AbstractNullnessCheckNode(IToken token) : base(token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractRestrictableStatement.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractRestrictableStatement.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractRestrictableStatement.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,9 +1,11 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; using log4net; using NHibernate.Hql.Ast.ANTLR.Util; namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public abstract class AbstractRestrictableStatement : AbstractStatement, IRestrictableStatement { private FromClause _fromClause; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractSelectExpression.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractSelectExpression.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractSelectExpression.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,7 +1,9 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public abstract class AbstractSelectExpression : HqlSqlWalkerNode, ISelectExpression { private string _alias; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractStatement.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractStatement.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractStatement.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -9,6 +9,7 @@ /// Author: Steve Ebersole /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public abstract class AbstractStatement : HqlSqlWalkerNode, IDisplayableNode, IStatement { protected AbstractStatement(IToken token) : base(token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,4 +1,5 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; using NHibernate.Type; using NHibernate.Hql.Ast.ANTLR.Util; @@ -10,6 +11,7 @@ /// Author: Joshua Davis /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public class AggregateNode : AbstractSelectExpression, ISelectExpression { public AggregateNode(IToken token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BetweenOperatorNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BetweenOperatorNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BetweenOperatorNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,13 +1,13 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; using NHibernate.Type; namespace NHibernate.Hql.Ast.ANTLR.Tree { - /** - * Contract for nodes representing logcial BETWEEN (ternary) operators. - * - * @author Steve Ebersole - */ + /// <summary> + /// Contract for nodes representing logcial BETWEEN (ternary) operators. + /// </summary> + [CLSCompliant(false)] public class BetweenOperatorNode : SqlNode, IOperatorNode { public BetweenOperatorNode(IToken token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryArithmeticOperatorNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryArithmeticOperatorNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryArithmeticOperatorNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -5,11 +5,10 @@ namespace NHibernate.Hql.Ast.ANTLR.Tree { - /** - * Nodes which represent binary arithmetic operators. - * - * @author Gavin King - */ + /// <summary> + /// Nodes which represent binary arithmetic operators. + /// </summary> + [CLSCompliant(false)] public class BinaryArithmeticOperatorNode : AbstractSelectExpression, IBinaryOperatorNode, IDisplayableNode { public BinaryArithmeticOperatorNode(IToken token) @@ -81,13 +80,13 @@ public override IType DataType { - /** - * Figure out the type of the binary expression by looking at - * the types of the operands. Sometimes we don't know both types, - * if, for example, one is a parameter. - */ get { + /* + * Figure out the type of the binary expression by looking at + * the types of the operands. Sometimes we don't know both types, + * if, for example, one is a parameter. + */ if (base.DataType == null) { base.DataType = ResolveDataType(); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryLogicOperatorNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryLogicOperatorNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryLogicOperatorNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -12,6 +12,7 @@ /// Author: Steve Ebersole /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public class BinaryLogicOperatorNode : HqlSqlWalkerNode, IBinaryOperatorNode { public BinaryLogicOperatorNode(IToken token) : base(token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BooleanLiteralNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BooleanLiteralNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BooleanLiteralNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -5,11 +5,10 @@ namespace NHibernate.Hql.Ast.ANTLR.Tree { - /** - * Represents a boolean literal within a query. - * - * @author Steve Ebersole - */ + ///<summary> + /// Represents a boolean literal within a query. + ///</summary> + [CLSCompliant(false)] public class BooleanLiteralNode : LiteralNode, IExpectedTypeAwareNode { private IType expectedType; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/Case2Node.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/Case2Node.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/Case2Node.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,14 +1,14 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; using NHibernate.Hql.Ast.ANTLR.Util; using NHibernate.Type; namespace NHibernate.Hql.Ast.ANTLR.Tree { - /** - * Represents a case ... when .. then ... else ... end expression in a select. - * - * @author Gavin King - */ + /// <summary> + /// Represents a case ... when .. then ... else ... end expression in a select. + /// </summary> + [CLSCompliant(false)] public class Case2Node : AbstractSelectExpression, ISelectExpression { public Case2Node(IToken token) : base(token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CaseNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CaseNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CaseNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -1,4 +1,5 @@ -using Antlr.Runtime; +using System; +using Antlr.Runtime; using NHibernate.Hql.Ast.ANTLR.Util; using NHibernate.Type; @@ -10,6 +11,7 @@ /// Author: Gavin King /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public class CaseNode : AbstractSelectExpression, ISelectExpression { public CaseNode(IToken token) : base(token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CollectionFunction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CollectionFunction.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CollectionFunction.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -8,6 +8,7 @@ /// Author: josh /// Ported by: Steve strong /// </summary> + [CLSCompliant(false)] public class CollectionFunction : MethodNode, IDisplayableNode { public CollectionFunction(IToken token) : base(token) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ConstructorNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ConstructorNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ConstructorNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -7,6 +7,7 @@ namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public class ConstructorNode : SelectExpressionList, ISelectExpression { private IType[] _constructorArgumentTypes; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DeleteStatement.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DeleteStatement.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DeleteStatement.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -8,6 +8,7 @@ /// Defines a top-level AST node representing an HQL delete statement. /// </summary> [Serializable] + [CLSCompliant(false)] public class DeleteStatement : AbstractRestrictableStatement { private static readonly ILog log = LogManager.GetLogger(typeof(QueryNode)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DotNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DotNode.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DotNode.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -17,6 +17,7 @@ /// Author: Joshua Davis /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public class DotNode : FromReferenceNode, ISelectExpression { private static readonly ILog log = LogManager.GetLogger(typeof(DotNode)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromClause.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromClause.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromClause.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -12,6 +12,7 @@ /// Author: josh /// Ported by: Steve Strong /// </summary> + [CLSCompliant(false)] public class FromClause : HqlSqlWalkerNode, IDisplayableNode { private static readonly ILog log = LogManager.GetLogger(typeof(FromClause)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElement.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElement.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElement.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -12,6 +12,7 @@ namespace NHibernate.Hql.Ast.ANTLR.Tree { + [CLSCompliant(false)] public class FromElement : HqlSqlWalkerNode, IDisplayableNode, IParameterContainer { private static readonly ILog log = LogManager.GetLogger(typeof(FromElement)); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementFactory.cs 2009-04-30 18:44:49 UTC (rev 4218) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementFactory.cs 2009-04-30 23:40:57 UTC (rev 4219) @@ -10,568 +10,569 @@ namespace NHibernate.Hql.Ast.ANTLR.Tree { - public class FromElementFactory - { - private static readonly ILog log = LogManager.GetLogger(typeof(FromElementFactory)); + [CLSCompliant(false)] + public class FromElementFactory + { + private static readonly ILog log = LogManager.GetLogger(typeof(FromElementFactory)); - private readonly FromClause _fromClause; - private readonly FromElement _origin; - private readonly string _path; - private readonly bool _collection; - private readonly string _classAlias; - private readonly string[] _columns; - private bool _implied; - private bool _inElementsFunction; - private IQueryableCollection _queryableCollection; - private CollectionType _collectionType; + private readonly FromClause _fromClause; + private readonly FromElement _origin; + private readonly string _path; + private readonly bool _collection; + private readonly string _classAlias; + private readonly string[] _columns; + private bool _implied; + private bool _inElementsFunction; + private IQueryableCollection _queryableCollection; + private CollectionType _collectionType; - /// <summary> - /// Creates entity from elements. - /// </summary> - /// <param name="fromClause"></param> - /// <param name="origin"></param> - /// <param name="path"></param> - public FromElementFactory(FromClause fromClause, FromElement origin, string path) - { - _fromClause = fromClause; - _origin = origin; - _path = path; - _collection = false; - } + /// <summary> + /// Creates entity from elements. + /// </summary> + /// <param name="fromClause"></param> + /// <param name="origin"></param> + /// <param name="path"></param> + public FromElementFactory(FromClause fromClause, FromElement origin, string path) + { + _fromClause = fromClause; + _origin = origin; + _path = path; + _collection = false; + } - /// <summary> - /// Creates collection from elements. - /// </summary> - /// <param name="fromClause"></param> - /// <param name="origin"></param> - /// <param name="path"></param> - /// <param name="classAlias"></param> - /// <param name="columns"></param> - /// <param name="implied"></param> - public FromElementFactory( - FromClause fromClause, - FromElement origin, - string path, - string classAlias, - string[] columns, - bool implied) - : this(fromClause, origin, path) - { - _classAlias = classAlias; - _columns = columns; - _implied = implied; - _collection = true; - } + /// <summary> + /// Creates collection from elements. + /// </summary> + /// <param name="fromClause"></param> + /// <param name="origin"></param> + /// <param name="path"></param> + /// <param name="classAlias"></param> + /// <param name="columns"></param> + /// <param name="implied"></param> + public FromElementFactory( + FromClause fromClause, + FromElement origin, + string path, + string classAlias, + string[] columns, + bool implied) + : this(fromClause, origin, path) + { + _classAlias = classAlias; + _columns = columns; + _implied = implied; + _collection = true; + } - public FromElement AddFromElement() - { - FromClause parentFromClause = _fromClause.ParentFromClause; - if (parentFromClause != null) - { - // Look up class name using the first identifier in the path. - string pathAlias = PathHelper.GetAlias(_path); - FromElement parentFromElement = parentFromClause.GetFromElement(pathAlias); - if (parentFromElement != null) - { - return CreateFromElementInSubselect(_path, pathAlias, parentFromElement, _classAlias); - } - } + public FromElement AddFromElement() + { + FromClause parentFromClause = _fromClause.ParentFromClause; + if (parentFromClause != null) + { + // Look up class name using the first identifier in the path. + string pathAlias = PathHelper.GetAlias(_path); + FromElement parentFromElement = parentFromClause.GetFromElement(pathAlias); + if (parentFromElement != null) + { + return CreateFromElementInSubselect(_path, pathAlias, parentFromElement, _classAlias); + } + } - IEntityPersister entityPersister = _fromClause.SessionFactoryHelper.RequireClassPersister(_path); + IEntityPersister entityPersister = _fromClause.SessionFactoryHelper.RequireClassPersister(_path); - FromElement elem = CreateAndAddFromElement(_path, - _classAlias, - entityPersister, - (EntityType)((IQueryable)entityPersister).Type, - null); + FromElement elem = CreateAndAddFromElement(_path, + _classAlias, + entityPersister, + (EntityType)((IQueryable)entityPersister).Type, + null); - // Add to the query spaces. - _fromClause.Walker.AddQuerySpaces(entityPersister.QuerySpaces); + // Add to the query spaces. + _fromClause.Walker.AddQuerySpaces(entityPersister.QuerySpaces); - return elem; - } + return elem; + } - public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection, - String collectionName) - { - JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName); - _queryableCollection = queryableCollection; - return CreateCollectionJoin(collectionJoinSequence, null); - } + public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection, + String collectionName) + { + JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName); + _queryableCollection = queryableCollection; + return CreateCollectionJoin(collectionJoinSequence, null); + } - private FromElement CreateFromElementInSubselect( - string path, - string pathAlias, - FromElement parentFromElement, - string classAlias) - { - if (log.IsDebugEnabled) - { - log.Debug("createFromElementInSubselect() : path = " + path); - } + private FromElement CreateFromElementInSubselect( + string path, + string pathAlias, + FromElement parentFromElement, + string classAlias) + { + if (log.IsDebugEnabled) + { + log.Debug("createFromElementInSubselect() : path = " + path); + } - // Create an DotNode AST for the path and resolve it. - FromElement fromElement = EvaluateFromElementPath(path, classAlias); - IEntityPersister entityPersister = fromElement.EntityPersister; + // Create an DotNode AST for the path and resolve it. + FromElement fromElement = EvaluateFromElementPath(path, classAlias); + IEntityPersister entityPersister = fromElement.EntityPersister; - // If the first identifier in the path referrs to the class alias (not the class name), then this - // is a correlated subselect. If it's a correlated sub-select, use the existing table alias. Otherwise - // generate a new one. - string tableAlias; - bool correlatedSubselect = pathAlias == parentFromElement.ClassAlias; - if (correlatedSubselect) - { - tableAlias = fromElement.TableAlias; - } - else - { - tableAlias = null; - } + // If the first identifier in the path referrs to the class alias (not the class name), then this + // is a correlated subselect. If it's a correlated sub-select, use the existing table alias. Otherwise + // generate a new one. + string tableAlias; + bool correlatedSubselect = pathAlias == parentFromElement.ClassAlias; + if (correlatedSubselect) + { + tableAlias = fromElement.TableAlias; + } + else + { + tableAlias = null; + } - // If the from element isn't in the same clause, create a new from element. - if (fromElement.FromClause != _fromClause) - { - if (log.IsDebugEnabled) - { - log.Debug("createFromElementInSubselect() : creating a new FROM element..."); - } + // If the from element isn't in the same clause, create a new from element. + if (fromElement.FromClause != _fromClause) + { + if (log.IsDebugEnabled) + { + log.Debug("createFromElementInSubselect() : creating a new FROM element..."); + } - fromElement = CreateFromElement(entityPersister); + fromElement = CreateFromElement(entityPersister); - InitializeAndAddFromElement(fromElement, - path, - classAlias, - entityPersister, - (EntityType)((IQueryable)entityPersister).Type, - tableAlias - ); - } - if (log.IsDebugEnabled) - { - log.Debug("createFromElementInSubselect() : " + path + " -> " + fromElement); - } + InitializeAndAddFromElement(fromElement, + path, + classAlias, + entityPersister, + (EntityType)((IQueryable)entityPersister).Type, + tableAlias + ); + } + if (log.IsDebugEnabled) + { + log.Debug("createFromElementInSubselect() : " + path + " -> " + fromElement); + } - return fromElement; - } + return fromElement; + } - public FromElement CreateCollection(IQueryableCollection queryableCollection, - string role, - JoinType joinType, - bool fetchFlag, - bool indexed) - { - if (!_collection) - { - throw new InvalidOperationException("FromElementFactory not initialized for collections!"); - } + public FromElement CreateCollection(IQueryableCollection queryableCollection, + string role, + JoinType joinType, + bool fetchFlag, + bool indexed) + { + if (!_collection) + { + throw new InvalidOperationException("FromElementFactory not initialized for collections!"); + } - _inElementsFunction = indexed; - FromElement elem; - _queryableCollection = queryableCollection; - _collectionType = queryableCollection.CollectionType; - string roleAlias = _fromClause.AliasGenerator.CreateName(role); + _inElementsFunction = indexed; + FromElement elem; + _queryableCollection = queryableCollection; + _collectionType = queryableCollection.CollectionType; + string roleAlias = _fromClause.AliasGenerator.CreateName(role); - // Correlated subqueries create 'special' implied from nodes - // because correlated subselects can't use an ANSI-style join - bool explicitSubqueryFromElement = _fromClause.IsSubQuery && !_implied; - if (explicitSubqueryFromElement) - { - string pathRoot = StringHelper.Root(_path); - FromElement origin = _fromClause.GetFromElement(pathRoot); - if (origin == null || origin.FromClause != _fromClause) - { - _implied = true; - } - } + // Correlated subqueries create 'special' implied from nodes + // because correlated subselects can't use an ANSI-style join + bool explicitSubqueryFromElement = _fromClause.IsSubQuery && !_implied; + if (explicitSubqueryFromElement) + { + string pathRoot = StringHelper.Root(_path); + FromElement origin = _fromClause.GetFromElement(pathRoot); + if (origin == null || origin.FromClause != _fromClause) + { + _implied = true; + } + } - // super-duper-classic-parser-regression-testing-mojo-magic... - if (explicitSubqueryFromElement && DotNode.UseThetaStyleImplicitJoins) - { - _implied = true; - } + // super-duper-classic-parser-regression-testing-mojo-magic... + if (explicitSubqueryFromElement && DotNode.UseThetaStyleImplicitJoins) + { + _implied = true; + } - IType elementType = queryableCollection.ElementType; + IType elementType = queryableCollection.ElementType; - if (elementType.IsEntityType) - { - // A collection of entities... - elem = CreateEntityAssociation(role, roleAlias, joinType); - } - else if (elementType.IsComponentType) - { - // A collection of components... - JoinSequence joinSequence = CreateJoinSequence(roleAlias, joinType); - elem = CreateCollectionJoin(joinSequence, roleAlias); - } - else - { - // A collection of scalar elements... - JoinSequence joinSequence = CreateJoinSequence(roleAlias, joinType); - elem = CreateCollectionJoin(joinSequence, roleAlias); - } + if (elementType.IsEntityType) + { + // A collection of entities... + elem = CreateEntityAssociation(role, roleAlias, joinType); + } + else if (elementType.IsComponentType) + { + // A collection of components... + JoinSequence joinSequence = CreateJoinSequence(roleAlias, joinType); + elem = CreateCollectionJoin(joinSequence, roleAlias); + } + else + { + // A collection of scalar elements... + JoinSequence joinSequence = CreateJoinSequence(roleAlias, joinType); + elem = CreateCollectionJoin(joinSequence, roleAlias); + } - elem.SetRole(role); - elem.QueryableCollection = queryableCollection; - // Don't include sub-classes for implied collection joins or subquery joins. - if (_implied) - { - elem.IncludeSubclasses = false; - } + elem.SetRole(role); + elem.QueryableCollection = queryableCollection; + // Don't include sub-classes for implied collection joins or subquery joins. + if (_implied) + { + elem.IncludeSubclasses = false; + } - if (explicitSubqueryFromElement) - { - elem.InProjectionList = true; // Treat explict from elements in sub-queries properly. - } + if (explicitSubqueryFromElement) + { + elem.InProjectionList = true; // Treat explict from elements in sub-queries properly. + } - if (fetchFlag) - { - elem.Fetch = true; - } - return elem; - } + if (fetchFlag) + { + elem.Fetch = true; + } + return elem; + } - public FromElement CreateElementJoin(IQueryableCollection queryableCollection) - { - FromElement elem; + public FromElement CreateElementJoin(IQueryableCollection queryableCollection) + { + FromElement elem; - _implied = true; //TODO: always true for now, but not if we later decide to support elements() in the from clause - _inElementsFunction = true; + _implied = true; //TODO: always true for now, but not if we later decide to support elements() in the from clause + _inElementsFunction = true; - IType elementType = queryableCollection.ElementType; + IType elementType = queryableCollection.ElementType; - if (!elementType.IsEntityType) - { - throw new InvalidOperationException("Cannot create element join for a collection of non-entities!"); - } + if (!elementType.IsEntityType) + { + throw new InvalidOperationException("Cannot create element join for a collection of non-entities!"); + } - _queryableCollection = queryableCollection; + _queryableCollection = queryableCollection; - SessionFactoryHelperExtensions sfh = _fromClause.SessionFactoryHelper; - FromElement destination = null; - string tableAlias = null; - IEntityPersister entityPersister = queryableCollection.ElementPersister; - tableAlias = _fromClause.AliasGenerator.CreateName(entityPersister.EntityName); - string associatedEntityName = entityPersister.EntityName; - IEntityPersister targetEntityPersister = sfh.RequireClassPersister(associatedEntityName); + SessionFactoryHelperExtensions sfh = _fromClause.SessionFactoryHelper; + FromElement destination = null; + string tableAlias = null; + IEntityPersister entityPersister = queryableCollection.ElementPersister; + tableAlias = _fromClause.AliasGenerator.CreateName(entityPersister.EntityName); + string associatedEntityName = entityPersister.EntityName; + IEntityPersister targetEntityPersister = sfh.RequireClassPersister(associatedEntityName); - // Create the FROM element for the target (the elements of the collection). - destination = CreateAndAddFromElement( - associatedEntityName, - _classAlias, - targetEntityPersister, - (EntityType)queryableCollection.ElementType, - tableAlias - ); + // Create the FROM element for the target (the elements of the collection). + destination = CreateAndAddFromElement( + associatedEntityName, + _classAlias, + targetEntityPersister, + (EntityType)queryableCollection.ElementType, + tableAlias + ); - // If the join is implied, then don't include sub-classes on the element. - if (_implied) - { - destination.IncludeSubclasses = false; - } + // If the join is implied, then don't include sub-classes on the element. + if (_implied) + { + destination.IncludeSubclasses = false; + } - _fromClause.AddCollectionJoinFromElementByPath(_path, destination); - // origin.addDestination(destination); - // Add the query spaces. - _fromClause.Walker.AddQuerySpaces(entityPersister.QuerySpaces); + _fromClause.AddCollectionJoinFromElementByPath(_path, destination); + // origin.addDestination(destination); + // Add the query spaces. + _fromClause.Walker.AddQuerySpaces(entityPersister.QuerySpaces); - CollectionType type = queryableCollection.CollectionType; - string role = type.Role; - string roleAlias = _origin.TableAlias; + CollectionType type = queryableCollection.CollectionType; + string role = type.Role; + string roleAlias = _origin.TableAlias; - string[] targetColumns = sfh.GetCollectionElementColumns(role, roleAlias); - IAssociationType elementAssociationType = sfh.GetElementAssociationType(type); + string[] targetColumns = sfh.GetCollectionElementColumns(role, roleAlias); + IAssociationType elementAssociationType = sfh.GetElementAssociationType(type); - // Create the join element under the from element. - JoinType joinType = JoinType.InnerJoin; - JoinSequence joinSequence = sfh.CreateJoinSequence(_implied, elementAssociationType, tableAlias, joinType, targetColumns); - elem = InitializeJoin(_path, destination, joinSequence, targetColumns, _origin, false); - elem.UseFromFragment = true; // The associated entity is implied, but it must be included in the FROM. - elem.CollectionTableAlias = roleAlias; // The collection alias is the role. - return elem; - } + // Create the join element under the from element. + JoinType joinType = JoinType.InnerJoin; + JoinSequence joinSequence = sfh.CreateJoinSequence(_implied, elementAssociationType, tableAlias, joinType, targetColumns); + elem = InitializeJoin(_path, destination, joinSequence, targetColumns, _origin, false); + elem.UseFromFragment = true; // The associated entity is implied, but it must be included in the FROM. + elem.CollectionTableAlias = roleAlias; // The collection alias is the role. + return elem; + } - public FromElement CreateEntityJoin( - string entityClass, - string tableAlias, - JoinSequence joinSequence, - bool fetchFlag, - bool inFrom, - EntityType type) - { - FromElement elem = CreateJoin(entityClass, tableAlias, joinSequence, type, false); - elem.Fetch = fetchFlag; - IEntityPersister entityPersister = elem.EntityPersister; - int numberOfTables = entityPersister.QuerySpaces.Length; + public FromElement CreateEntityJoin( + string entityClass, + string tableAlias, + JoinSequence joinSequence, + bool fetchFlag, + bool inFrom, + EntityType type) + { + FromElement elem = CreateJoin(entityClass, tableAlias, joinSequence, type, false); + elem.Fetch = fetchFlag; + IEntityPersister entityPersister = elem.EntityPersister; + int numberOfTables = entityPersister.QuerySpaces.Length; - if (numberOfTables > 1 && _implied && !elem.UseFromFragment) - { - if (log.IsDebugEnabled) - { - log.Debug("createEntityJoin() : Implied multi-table entity join"); - } - elem.UseFromFragment = true; - } + if (numberOfTables > 1 && _implied && !elem.UseFromFragment) + { + if (log.IsDebugEnabled) + { + log.Debug("createEntityJoin() : Implied multi-table entity join"); + } + elem.UseFromFragment = true; + } - // If this is an implied join in a FROM clause, then use ANSI-style joining, and set the - // flag on the FromElement that indicates that it was implied in the FROM clause itself. - if (_implied && inFrom) - { - joinSequence.SetUseThetaStyle(false); - elem.UseFromFragment = true; - elem.SetImpliedInFromClause(true); - } - if (elem.Walker.IsSubQuery) - { - // two conditions where we need to transform this to a theta-join syntax: - // 1) 'elem' is the "root from-element" in correlated subqueries - // 2) The DotNode.useThetaStyleImplicitJoins has been set to true - // and 'elem' represents an implicit join - if (elem.FromClause != elem.Origin.FromClause || - // ( implied && DotNode.useThetaStyleImplicitJoins ) ) { - DotNode.UseThetaStyleImplicitJoins) - { - // the "root from-element" in correlated subqueries do need this piece - elem.Type = HqlSqlWalker.FROM_FRAGMENT; - joinSequence.SetUseThetaStyle(true); - elem.UseFromFragment = false; - } - } + // If this is an implied join in a FROM clause, then use ANSI-style joining, and set the + // flag on the FromElement that indicates that it was implied in the FROM clause itself. + if (_implied && inFrom) + { + joinSequence.SetUseThetaStyle(false); + elem.UseFromFragment = true; + elem.SetImpliedInFromClause(true); + } + if (elem.Walker.IsSubQuery) + { + // two conditions where we need to transform this to a theta-join syntax: + // 1) 'elem' is the "root from-element" in correlated subqueries + // 2) The DotNode.useThetaStyleImplicitJoins has been set to true + // and 'elem' represents an implicit join + if (elem.FromClause != elem.Origin.FromClause || + // ( implied && DotNode.useThetaStyleImplicitJoins ) ) { + DotNode.UseThetaStyleImplicitJoins) + { + // the "root from-element" in correlated subqueries do need this piece + elem.Type = HqlSqlWalker.FROM_FRAGMENT; + joinSequence.SetUseThetaStyle(true); + elem.UseFromFragment = false; + } + } - return elem; - } + return elem; + } - private FromElement CreateEntityAssociation( - string role, - string roleAlias, - JoinType joinType) - { - FromElement elem; - IQueryable entityPersister = (IQueryable)_queryableCollection.ElementPersister; - string associatedEntityName = entityPersister.EntityName; + private FromElement CreateEntityAssociation( + string role, + string roleAlias, + JoinType joinType) + { + FromElement elem; + IQueryable entityPersister = (IQueryable)_queryableCollection.ElementPersister; + string associatedEntityName = entityPersister.EntityName; - // Get the class name of the associated entity. - if (_queryableCollection.IsOneToMany) - { - if (log.IsDebugEnabled) - { - log.Debug("createEntityAssociation() : One to many - path = " + _path + " role = " + role + " associatedEntityName = " + associatedEntityName); - } + // Get the class name of the associated entity. + if (_queryableCollection.IsOneToMany) + { + if (log.IsDebugEnabled) + { + log.Debug("createEntityAssociation() : One to many - path = " + _path + " role = " + role + " associatedEntityName = " + associatedEntityName); + } - JoinSequence joinSequence = CreateJoinSequence(roleAlias, joinType); + JoinSequence joinSequence = CreateJoinSequence(roleAlias, joinType); - elem = CreateJoin(associatedEntityName, roleAlias, joinSequence, (EntityType)_queryableCollection.ElementType, false); - } - else - { - if (log.IsDebugEnabled) - { - log.Debug("createManyToMany() : path = " + _path + " role = " + role + " associatedEntityName = " + associatedEntityName); - } + elem = CreateJoin(associatedEntityName, roleAlias, joinSequence, (EntityType)_queryableCollection.ElementType, false); + } + else + { + if (log.IsDebugEnabled) + { + log.Debug("createManyToMany() : path = " + _path + " role = " + role + " associatedEntityName = " + associatedEntityName); + } - elem = CreateManyToMany(role, associatedEntityName, - roleAlias, entityPersister, (EntityType)_queryableCollection.ElementType, joinType); - _fromClause.Walker.AddQuerySpaces(_queryableCollection.CollectionSpaces); - } - elem.CollectionTableAlias = roleAlias; - return elem; - } + elem = CreateManyToMany(role, associatedEntityName, + roleAlias, entityPersister, (EntityType)_queryableCollection.ElementType, joinType); + _fromClause.Walker.AddQuerySpaces(_queryableCollection.CollectionSpaces); + } + elem.CollectionTableAlias = roleAlias; + return elem; + } - private FromElement CreateCollectionJoin(JoinSequence collectionJoinSequence, string tableAlias) - { - string text = _queryableCollection.TableName; - IASTNode ast = CreateFromElement(text); - FromElement destination = (FromElement)ast; - IType elementType = _queryableCollection.ElementType; + private FromElement CreateCollectionJoin(JoinSequence collectionJoinSequence, string tableAlias) + { + string text = _queryableCollection.TableName; + IASTNode ast = CreateFromElement(text); + FromElement destination = (FromElement)ast; + IType elementType = _queryableCollection.ElementType; - if (elementType.IsCollectionType) - { - throw new SemanticException("Collections of collections are not supported!"); - } + if (elementType.IsCollectionType) + { + throw new SemanticException("Collections of collections are not supported!"); + } - destination.InitializeCollection(_fromClause, _classAlia... [truncated message content] |