Example #1
0
        protected virtual void OnProcessWhereStringExactMemberNode(ISqlWhereCriteriaBuilder builder, StringExactMemberNode memberNode, int memberIndex)
        {
            builder.AddRaw("(");

            builder.AddMember(memberNode, memberIndex);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddValue(new ValueNode(memberNode.Value));
            builder.Flush();

            builder.AddRaw(" and ");

            const string castAsVarbinary = "cast({0} as varbinary(300))";

            builder.AddMember(memberNode, memberIndex, castAsVarbinary);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddLastValueAgain(castAsVarbinary);
            builder.Flush();

            builder.AddRaw(")");
        }
 protected virtual void OnProcessWhereImplicitBoolMemberNode(ISqlWhereCriteriaBuilder builder, MemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Equal()));
     builder.AddValue(new ValueNode(true));
 }
 protected virtual void OnProccessWhereStringStartsWithMemberNode(ISqlWhereCriteriaBuilder builder, StringStartsWithMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat(memberNode.Value, "%")));
 }
        protected virtual void OnProcessWhereStringExactMemberNode(ISqlWhereCriteriaBuilder builder, StringExactMemberNode memberNode, int memberIndex)
        {
            builder.AddRaw("(");
            
            builder.AddMember(memberNode, memberIndex);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddValue(new ValueNode(memberNode.Value));
            builder.Flush();

            builder.AddRaw(" and ");

            const string castAsVarbinary = "cast({0} as varbinary(300))";
            builder.AddMember(memberNode, memberIndex, castAsVarbinary);
            builder.AddOp(new OperatorNode(Operator.Equal()));
            builder.AddLastValueAgain(castAsVarbinary);
            builder.Flush();

            builder.AddRaw(")");
        }
 protected virtual void OnProcessWhereStringContainsMemberNode(ISqlWhereCriteriaBuilder builder, StringContainsMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat("%", memberNode.Value, "%").Replace("%%", "%")));
 }
 protected virtual void OnProcessWhereLikeMemberNode(ISqlWhereCriteriaBuilder builder, LikeMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(memberNode.Value));
 }
 protected virtual void OnProcessWhereInSetMemberNode(ISqlWhereCriteriaBuilder builder, InSetMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.InSet()));
     builder.AddSetOfValues(new ArrayValueNode(memberNode.DataType, memberNode.DataTypeCode, memberNode.Values));
 }
Example #8
0
 protected virtual void OnProcessWhereImplicitBoolMemberNode(ISqlWhereCriteriaBuilder builder, MemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Equal()));
     builder.AddValue(new ValueNode(true));
 }
Example #9
0
 protected virtual void OnProccessWhereStringStartsWithMemberNode(ISqlWhereCriteriaBuilder builder, StringStartsWithMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat(memberNode.Value, "%")));
 }
Example #10
0
 protected virtual void OnProcessWhereStringContainsMemberNode(ISqlWhereCriteriaBuilder builder, StringContainsMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(string.Concat("%", memberNode.Value, "%").Replace("%%", "%")));
 }
Example #11
0
 protected virtual void OnProcessWhereLikeMemberNode(ISqlWhereCriteriaBuilder builder, LikeMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.Like()));
     builder.AddValue(new ValueNode(memberNode.Value));
 }
Example #12
0
 protected virtual void OnProcessWhereNotInSetMemberNode(ISqlWhereCriteriaBuilder builder, NotInSetMemberNode memberNode, int memberIndex)
 {
     builder.AddMember(memberNode, memberIndex);
     builder.AddOp(new OperatorNode(Operator.NotInSet()));
     builder.AddSetOfValues(new ArrayValueNode(memberNode.DataType, memberNode.DataTypeCode, memberNode.Values));
 }