public virtual IClassMap GetRootClassMap(string npath, IDomainMap domainMap)
        {
            NPathParser parser = new NPathParser() ;
            NPathSelectQuery query = parser.ParseSelectQuery(npath) ;

            string className = 	((NPathClassName)query.From.Classes[0]).Name;

            IClassMap rootClassMap = domainMap.MustGetClassMap(className);
            return rootClassMap;
        }
        public virtual NPathQueryType GetNPathQueryType(string npath)
        {
            NPathQueryType npathQueryType = NPathQueryType.SelectObjects;

            try
            {
                NPathParser parser = new NPathParser() ;
                NPathSelectQuery query = parser.ParseSelectQuery(npath) ;

                npathQueryType = GetNPathQueryType(query);
            }
            catch
            {
                npathQueryType = NPathQueryType.SelectObjects;
            }

            return npathQueryType;
        }
        protected virtual NPathSelectQuery Parse(string npathQuery, IList parameters)
        {
            NPathParser parser = new NPathParser();

            return(parser.ParseSelectQuery(npathQuery, parameters));
        }
        protected virtual NPathSelectQuery Parse(string npathQuery)
        {
            NPathParser parser = new NPathParser();

            return(parser.ParseSelectQuery(npathQuery, new ArrayList()));
        }
        public virtual string ToScalarSql(string npath, Type type, ref IList outParameters, IList inParameters)
        {
            NPathParser parser = new NPathParser() ;
            NPathSelectQuery query = parser.ParseSelectQuery(npath, inParameters) ;

            IClassMap rootClassMap = this.Context.DomainMap.MustGetClassMap(type);

            this.ResultParameters = new ArrayList();

            SqlEmitter sqlEmitter = new SqlEmitter(this, query,NPathQueryType.SelectScalar, rootClassMap);

            string sql = sqlEmitter.EmitSql();

            outParameters = sqlEmitter.ResultParameters;

            return sql;
        }
 protected virtual NPathSelectQuery Parse(string npathQuery, IList parameters)
 {
     NPathParser parser = new NPathParser();
     return parser.ParseSelectQuery(npathQuery, parameters);
 }
 protected virtual NPathSelectQuery Parse(string npathQuery)
 {
     NPathParser parser = new NPathParser();
     return parser.ParseSelectQuery(npathQuery, new ArrayList());
 }
Example #8
0
		private SqlExpression EvalMethodCall (NPathMethodCall methodCall)
		{
			if (methodCall.MethodName == "Count" && methodCall.Parameters.Count == 0)
			{
				string npath = string.Format("select count(*) from {0}",methodCall.PropertyPath.Path);
				
				NPathParser parser = new NPathParser() ;
				NPathSelectQuery query = parser.ParseSelectQuery(npath) ;
				NPathParenthesisGroup pg = new NPathParenthesisGroup() ;
				pg.IsNegative = methodCall.PropertyPath.IsNegative;
				pg.Expression = query;
				return EvalExpression (pg);				
			}

			throw new IAmOpenSourcePleaseImplementMeException (string.Format("Method calls to '{0}' is not yet implemented",methodCall.MethodName));
		}