internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; if (this.instanceClasses.Length == 1) { statement.Append(" (" + statement.GetJoinName(this.role) + "." + Mapping.ColumnNameForType + " IS NOT NULL AND "); statement.Append(" " + statement.GetJoinName(this.role) + "." + Mapping.ColumnNameForType + "=" + 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(" (" + statement.GetJoinName(this.role) + "." + Mapping.ColumnNameForType + " IS NOT NULL AND "); statement.Append(" " + statement.GetJoinName(this.role) + "." + Mapping.ColumnNameForType + "=" + statement.AddParameter(this.instanceClasses[i].Id) + ")"); if (i < this.instanceClasses.Length - 1) { statement.Append(" OR "); } } statement.Append(" ) "); } return this.Include; }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; if (this.instanceClasses.Length == 1) { statement.Append(alias + "." + Mapping.ColumnNameForClass + "=" + 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 + "." + Mapping.ColumnNameForClass + "=" + statement.AddParameter(this.instanceClasses[i].Id)); if (i < this.instanceClasses.Length - 1) { statement.Append(" OR "); } } statement.Append(" ) "); } return(this.Include); }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; if (this.roleType.ObjectType.IsUnit) { statement.Append(" " + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + "=" + statement.AddParameter(this.obj)); } else { var allorsObject = (IObject)this.obj; if (this.roleType.RelationType.ExistExclusiveClasses) { statement.Append(" (" + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + " IS NOT NULL AND "); statement.Append(" " + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + "=" + allorsObject.Strategy.ObjectId + ")"); } else { statement.Append(" (" + this.roleType.SingularFullName + "_R." + Mapping.ColumnNameForRole + " IS NOT NULL AND "); statement.Append(" " + this.roleType.SingularFullName + "_R." + Mapping.ColumnNameForRole + "=" + allorsObject.Strategy.ObjectId + ")"); } } return this.Include; }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; statement.Append(" (" + alias + "." + Mapping.ColumnNameForObject + "=" + statement.AddParameter(this.obj) + ") "); return(this.Include); }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; statement.Append(" " + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + " < " + statement.AddParameter(this.obj)); return this.Include; }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; statement.Append(" " + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + " < " + statement.AddParameter(this.obj)); return(this.Include); }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; statement.Append(" (" + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + " BETWEEN " + statement.AddParameter(this.first) + " AND " + statement.AddParameter(this.second) + ")"); return(this.Include); }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; statement.Append(" (" + alias + "." + Mapping.ColumnNameForObject + "=" + statement.AddParameter(this.obj) + ") "); return this.Include; }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; if (this.roleType.ObjectType.IsUnit) { statement.Append(" " + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + "=" + statement.AddParameter(this.obj)); } else { var allorsObject = (IObject)this.obj; if (this.roleType.RelationType.ExistExclusiveClasses) { statement.Append(" (" + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + " IS NOT NULL AND "); statement.Append(" " + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + "=" + allorsObject.Strategy.ObjectId + ")"); } else { statement.Append(" (" + this.roleType.SingularFullName + "_R." + Mapping.ColumnNameForRole + " IS NOT NULL AND "); statement.Append(" " + this.roleType.SingularFullName + "_R." + Mapping.ColumnNameForRole + "=" + allorsObject.Strategy.ObjectId + ")"); } } return(this.Include); }
internal override bool BuildWhere(ExtentStatement statement, string alias) { var schema = statement.Mapping; statement.Append(" (" + alias + "." + schema.ColumnNameByRelationType[this.roleType.RelationType] + " BETWEEN " + statement.AddParameter(this.first) + " AND " + statement.AddParameter(this.second) + ")"); return this.Include; }