protected internal override Expression VisitTypeFieldInit(TypeEntityExpression typeFie)
 {
     return(Expression.Condition(
                Expression.NotEqual(Visit(NullifyColumn(typeFie.ExternalId)), NullId),
                Expression.Constant(typeFie.TypeValue, typeof(Type)),
                NullType));
 }
Exemplo n.º 2
0
        private static Expression TypeFieFieEquals(TypeEntityExpression typeFie1, TypeEntityExpression typeFie2)
        {
            if (typeFie1.TypeValue != typeFie2.TypeValue)
            {
                return(False);
            }

            return(Expression.And(NotEqualToNull(typeFie1.ExternalId), NotEqualToNull(typeFie2.ExternalId)));
        }
Exemplo n.º 3
0
        protected internal virtual Expression VisitTypeEntity(TypeEntityExpression typeFie)
        {
            var externalId = (PrimaryKeyExpression)Visit(typeFie.ExternalId);

            if (externalId != typeFie.ExternalId)
            {
                return(new TypeEntityExpression(externalId, typeFie.TypeValue));
            }

            return(typeFie);
        }
Exemplo n.º 4
0
        private static Expression TypeFieIbEquals(TypeEntityExpression typeFie, TypeImplementedByExpression typeIb)
        {
            var externalId = typeIb.TypeImplementations.TryGetC(typeFie.TypeValue);

            if (externalId == null)
            {
                return(False);
            }

            return(Expression.And(NotEqualToNull(typeFie.ExternalId), NotEqualToNull(externalId)));
        }
Exemplo n.º 5
0
        private static Expression TypeConstantFieEquals(ConstantExpression ce, TypeEntityExpression typeFie)
        {
            if (ce.IsNull())
            {
                return(EqualsToNull(typeFie.ExternalId));
            }

            if (((Type)ce.Value == typeFie.TypeValue))
            {
                return(NotEqualToNull(typeFie.ExternalId));
            }

            return(False);
        }
Exemplo n.º 6
0
        private bool IsCacheable(Expression newTypeId)
        {
            TypeEntityExpression tfie = newTypeId as TypeEntityExpression;

            if (tfie != null)
            {
                return(IsCached(tfie.TypeValue));
            }

            TypeImplementedByExpression tibe = newTypeId as TypeImplementedByExpression;

            if (tibe != null)
            {
                return(tibe.TypeImplementations.All(t => IsCached(t.Key)));
            }

            return(false);
        }
Exemplo n.º 7
0
 protected internal override Expression VisitTypeEntity(TypeEntityExpression typeFie)
 {
     throw InvalidSqlExpression(typeFie);
 }
Exemplo n.º 8
0
 protected virtual bool CompareTypeFieldInit(TypeEntityExpression a, TypeEntityExpression b)
 {
     return(a.TypeValue == b.TypeValue &&
            Compare(a.ExternalId, b.ExternalId));
 }
 protected internal override Expression VisitTypeFieldInit(TypeEntityExpression typeFie)
 {
     return(base.VisitTypeFieldInit(typeFie));
 }
Exemplo n.º 10
0
 private static Expression TypeFieIbaEquals(TypeEntityExpression typeFie, TypeImplementedByAllExpression typeIba)
 {
     return Expression.And(NotEqualToNull(typeFie.ExternalId), EqualNullable(typeIba.TypeColumn, QueryBinder.TypeConstant(typeFie.TypeValue)));
 }
Exemplo n.º 11
0
        private static Expression TypeFieIbEquals(TypeEntityExpression typeFie, TypeImplementedByExpression typeIb)
        {
            var externalId = typeIb.TypeImplementations.TryGetC(typeFie.TypeValue);

            if (externalId == null)
                return False;

            return Expression.And(NotEqualToNull(typeFie.ExternalId), NotEqualToNull(externalId));
        }
Exemplo n.º 12
0
        private static Expression TypeFieFieEquals(TypeEntityExpression typeFie1, TypeEntityExpression typeFie2)
        {
            if (typeFie1.TypeValue != typeFie2.TypeValue)
                return False;

            return Expression.And(NotEqualToNull(typeFie1.ExternalId), NotEqualToNull(typeFie2.ExternalId));
        }
Exemplo n.º 13
0
        private static Expression TypeConstantFieEquals(ConstantExpression ce, TypeEntityExpression typeFie)
        {
            if (ce.IsNull())
                return EqualsToNull(typeFie.ExternalId);

            if (((Type)ce.Value == typeFie.TypeValue))
                return NotEqualToNull(typeFie.ExternalId);

            return False;
        }
Exemplo n.º 14
0
        protected virtual Expression VisitTypeFieldInit(TypeEntityExpression typeFie)
        {
            var externalId = Visit(typeFie.ExternalId);

            if (externalId != typeFie.ExternalId)
                return new TypeEntityExpression(externalId, typeFie.TypeValue);

            return typeFie;
        }
Exemplo n.º 15
0
 protected override Expression VisitTypeFieldInit(TypeEntityExpression typeFie)
 {
     return base.VisitTypeFieldInit(typeFie);
 }
Exemplo n.º 16
0
 private static Expression TypeFieIbaEquals(TypeEntityExpression typeFie, TypeImplementedByAllExpression typeIba)
 {
     return(Expression.And(NotEqualToNull(typeFie.ExternalId), EqualNullable(typeIba.TypeColumn, QueryBinder.TypeConstant(typeFie.TypeValue))));
 }
Exemplo n.º 17
0
 protected override Expression VisitTypeFieldInit(TypeEntityExpression typeFie)
 {
     throw InvalidSqlExpression(typeFie);
 }