public Criteria SetDouble(int pos, double value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(Types.DOUBLE); parameters.Add(pos, p); return(this); }
public Criteria SetInt(int pos, int value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(Types.INTEGER); parameters.Add(pos, p); return(this); }
public Criteria SetObject(int pos, Object value, DataField dataField) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(SQLUtils.ToSqlType(dataField.getSqlType())); parameters.Add((pos), p); return(this); }
public Criteria SetString(int pos, String value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(Types.VARCHAR); parameters.Add(pos, p); return(this); }
public Criteria SetDate(int pos, DateTime value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(Types.DATE); parameters.Add(pos, p); return(this); }
public Criteria SetTimestamp(int pos, DateTime value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(Types.TIMESTAMP); parameters. Add((pos), p); return(this); }
public Criteria SetTime(int pos, TimeSpan value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value); p.SetSqlType(Types.TIME); parameters. Add((pos), p); return(this); }
public Criteria SetBoolean(int pos, bool value) { SqlParam p = new SqlParam(); p.SetPos(pos); p.SetValue(value ? (1) : (0)); p.SetSqlType(Types.INTEGER); parameters. Add((pos), p); return(this); }
public Criteria Merge(Criteria other) { if (other == null) { return(this); } Criteria newCriteria = new Criteria(); StringBuilder sb = new StringBuilder(); if (whereClause != null) { sb.Append(whereClause); } if (other.whereClause != null) { if (sb.Length > 0) { sb.Append(" AND "); } sb.Append(other.whereClause); } newCriteria.whereClause = sb.Length == 0 ? null : sb.ToString(); sb = new StringBuilder(); if (joins != null) { sb.Append(joins); } if (other.joins != null) { sb.Append(" "); sb.Append(other.joins); } newCriteria.joins = sb.Length == 0 ? null : sb.ToString(); int pos = 1; for (int i = 0; i < parameters.Count; i++) { newCriteria.parameters.Add((pos), parameters[i + 1]); pos++; } for (int i = 0; i < other.parameters.Count; i++) { SqlParam p = (SqlParam)other.parameters[i + 1]; p.SetPos(pos); newCriteria.parameters.Add((pos), p); pos++; } if (minRowIndex >= 0) { newCriteria.minRowIndex = minRowIndex; } if (other.minRowIndex >= 0) { newCriteria.minRowIndex = other.minRowIndex; } if (maxRowIndex >= 0) { newCriteria.maxRowIndex = maxRowIndex; } if (other.maxRowIndex >= 0) { newCriteria.maxRowIndex = other.maxRowIndex; } if (distinct || other.IsDistinct()) { newCriteria.distinct = other.distinct; } return(newCriteria); }