public override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Schema; if (this.instanceClasses.Length == 1) { statement.Append(alias + "." + schema.TypeId + "=" + statement.AddParameter(this.instanceClasses[0].Id) + " "); } else if (this.instanceClasses.Length > 1) { statement.Append(" ( "); for (var i = 0; i < this.instanceClasses.Length; i++) { statement.Append(alias + "." + schema.TypeId + "=" + statement.AddParameter(this.instanceClasses[i].Id)); if (i < this.instanceClasses.Length - 1) { statement.Append(" OR "); } } statement.Append(" ) "); } return(this.Include); }
public override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Schema; statement.Append(" (" + alias + "." + schema.Column(this.roleType) + " BETWEEN " + statement.AddParameter(this.first) + " AND " + statement.AddParameter(this.second) + ")"); return(this.Include); }
public override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Schema; statement.Append(" " + alias + "." + schema.Column(this.role) + " LIKE " + statement.AddParameter(this.like)); return(this.Include); }
public override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Schema; if (this.roleType.ObjectType is IUnit) { statement.Append(" " + alias + "." + schema.Column(this.roleType) + "=" + statement.AddParameter(this.obj)); } else { var allorsObject = (IObject)this.obj; if (this.roleType.RelationType.ExistExclusiveClasses) { statement.Append(" (" + alias + "." + schema.Column(this.roleType) + " IS NOT NULL AND "); statement.Append(" " + alias + "." + schema.Column(this.roleType) + "=" + allorsObject.Strategy.ObjectId + ")"); } else { statement.Append(" (" + this.roleType.SingularPropertyName + "_R." + schema.RoleId + " IS NOT NULL AND "); statement.Append(" " + this.roleType.SingularPropertyName + "_R." + schema.RoleId + "=" + allorsObject.Strategy.ObjectId + ")"); } } return(this.Include); }