Package org.datanucleus.store.mapped.expression

Examples of org.datanucleus.store.mapped.expression.BooleanExpression


        if (hasDiscriminator && restrictDiscriminator)
        {
            // Add the discriminator required values to the WHERE clause
            // Loop through each possible candidate type and add the discrim values for each branch
            boolean multipleDiscriminatorValues = candidateTypes.length > 1 ? true: false;
            BooleanExpression discExpr = null;
            for (int i=0; i<candidateTypes.length; i++)
            {
                // For this candidate type, go through the possible classes persistable in this table and add an OR to the WHERE clause
                String candidateName = candidateTypes[i].getName();
                BooleanExpression discExprCand = getExpressionForDiscriminatorForClass(stmt, candidateName,
                    dismd, discriminatorMapping, discrimTableExpr, storeMgr);
                if (discExpr != null)
                {
                    discExpr = discExpr.ior(discExprCand);
                }
                else
                {
                    discExpr = discExprCand;
                }
                if (includeSubclasses)
                {
                    Iterator iterator = storeMgr.getSubClassesForClass(candidateName, true, clr).iterator();
                    while (iterator.hasNext())
                    {
                        String subCandidateType = (String)iterator.next();
                        BooleanExpression discExprSub = getExpressionForDiscriminatorForClass(stmt,
                            subCandidateType, dismd, discriminatorMapping, discrimTableExpr, storeMgr);
                        discExpr = discExpr.ior(discExprSub);
                        if (!multipleDiscriminatorValues)
                        {
                            multipleDiscriminatorValues = true;
                        }
                    }
                }
            }

            if (allowNulls)
            {
                // Allow for null value of discriminator
                ScalarExpression expr = discriminatorMapping.newScalarExpression(stmt, discrimTableExpr);
                ScalarExpression val = new NullLiteral(stmt);
                BooleanExpression nullDiscExpr = expr.eq(val);
                discExpr = discExpr.ior(nullDiscExpr);
                if (!multipleDiscriminatorValues)
                {
                    multipleDiscriminatorValues = true;
                }
View Full Code Here


        DatastoreMapping data_mapping = getDataStoreMapping(0);
        if (data_mapping.isBitBased() || data_mapping.isIntegerBased())
        {
            if (dba.supportsOption(DatastoreAdapter.BIT_IS_REALLY_BOOLEAN))
            {
                expr = new BooleanExpression(qs, this, te);
            }
            else
            {
                expr = new BooleanBitColumnExpression(qs, this, te);
            }
        }
        else if (data_mapping.isBooleanBased())
        {
            expr = new BooleanExpression(qs, this, te);
        }
        else if (data_mapping.isStringBased())
        {
            expr = new BooleanCharColumnExpression(qs, this, te);
        }
        else
        {
            expr = new BooleanExpression(qs, this, te);
        }

        return expr;
    }
View Full Code Here

TOP

Related Classes of org.datanucleus.store.mapped.expression.BooleanExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.