Azavea.Open.DAO.SQL.SqlDaLayer.ExpressionsToQuery C# (CSharp) Method

ExpressionsToQuery() public method

Takes a DaoCriteria, converts it to a " WHERE ..." chunk of SQL. The SQL will begin with a space if non-empty.
public ExpressionsToQuery ( SqlDaQuery queryToAddTo, DaoCriteria crit, ClassMapping mapping ) : void
queryToAddTo SqlDaQuery Query we're adding the expression to.
crit Azavea.Open.DAO.Criteria.DaoCriteria Serializable critera to get the expressions from.
mapping ClassMapping Class mapping for the class we're dealing with.
return void
        public virtual void ExpressionsToQuery(SqlDaQuery queryToAddTo, DaoCriteria crit,
            ClassMapping mapping)
        {
            if (crit != null)
            {
                if (crit.Expressions.Count > 0)
                {
                    string colPrefix = _fullyQualifyColumnNames ? mapping.Table + "." : null;
                    queryToAddTo.Sql.Append(" WHERE ");
                    ExpressionListToQuery(queryToAddTo, crit.BoolType, crit.Expressions,
                                          mapping, colPrefix);
                }
            }
        }