/// <summary>
        /// Render the SQL Fragment.
        /// </summary>
        /// <param name="criteria"></param>
        /// <param name="position"></param>
        /// <param name="criteriaQuery"></param>
        /// <param name="enabledFilters"></param>
        /// <returns></returns>
        public override SqlString ToSqlString(ICriteria criteria, int position, ICriteriaQuery criteriaQuery, IDictionary <string, IFilter> enabledFilters)
        {
            ISpatialDialect spatialDialect = (ISpatialDialect)criteriaQuery.Factory.Dialect;
            string          column1        = criteriaQuery.GetColumn(criteria, this.propertyName);
            string          column2        = criteriaQuery.GetColumn(criteria, this.anotherPropertyName);

            SqlString sqlString;

            if (this.pattern == null)
            {
                sqlString = spatialDialect.GetSpatialRelateString(column1, column2, null, false, false);
            }
            else
            {
                string column3 = criteriaQuery.GetColumn(criteria, this.pattern);
                if (column3 == null)
                {
                    sqlString = spatialDialect.GetSpatialRelateString(column1, column2, this.pattern, true, false);
                }
                else
                {
                    sqlString = spatialDialect.GetSpatialRelateString(column1, column2, column3, false, false);
                }
            }
            return(new SqlStringBuilder()
                   .Add(sqlString)
                   .Add(" as y")
                   .Add(position.ToString())
                   .Add("_")
                   .ToSqlString());
        }
Ejemplo n.º 2
0
 public SqlString GetSpatialRelateString(object geometry, object anotherGeometry, object pattern, bool isStringPattern, bool criterion)
 {
     return(worker.GetSpatialRelateString(geometry, anotherGeometry, pattern, isStringPattern, criterion));
 }