Package org.datanucleus.store.mapped.expression

Examples of org.datanucleus.store.mapped.expression.QueryExpression.newTableExpression()


            // Select the required "selectTable"
            stmt = dba.newQueryStatement(selectTable, candidateAlias, clr);

            // Join from the "selectTable" to the table of our candidate
            ScalarExpression selectExpression = selectCandidateMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
            LogicSetExpression candidateTableExpression = stmt.newTableExpression(candidateTable, candidateTableIdentifier);
            ScalarExpression candidateExpression = candidateTable.getIDMapping().newScalarExpression(stmt, candidateTableExpression);
            if (allowNulls)
            {
                // Do LEFT OUTER JOIN since we need to allow nulls in the results
                stmt.leftOuterJoin(selectExpression, candidateExpression, candidateTableExpression, true);
View Full Code Here


            IdentifierFactory idFactory = stmt.getStoreManager().getIdentifierFactory();

            // Add join from the join table to the root element table
            DatastoreIdentifier targetTableIdentifier = null;
            DatastoreIdentifier rootElementTblId = idFactory.newIdentifier(IdentifierType.TABLE, "ELEMENT");
            LogicSetExpression rootElementTblExpr = stmt.newTableExpression(candidateTable, rootElementTblId);
            ScalarExpression sourceExpr = sourceMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
            ScalarExpression rootElementExpr =
                candidateTable.getIDMapping().newScalarExpression(stmt, rootElementTblExpr);
            if (allowNull)
            {
View Full Code Here

            if (targetElementTable != candidateTable)
            {
                // Add join from the root element table to the target element table
                DatastoreIdentifier tgtElementTblId = idFactory.newIdentifier(IdentifierType.TABLE, "ELMNTSUB");
                LogicSetExpression tgtElementTblExpr = stmt.newTableExpression(targetElementTable, tgtElementTblId);
                ScalarExpression targetExpr =
                    targetElementTable.getIDMapping().newScalarExpression(stmt, tgtElementTblExpr);
                if (allowNull)
                {
                    stmt.leftOuterJoin(rootElementExpr, targetExpr, tgtElementTblExpr, true);
View Full Code Here

                    // create a new statement
                    targetQS = dba.newQueryStatement(targetSubElementTypes[i], tiTargetSubElementType, stmt.getClassLoaderResolver());

                    // table expression from the table identifier
                    teTargetSubElementType = targetQS.newTableExpression(targetSubElementTypes[i], tiTargetSubElementType);

                    JavaTypeMapping targetMapping = targetSubElementTypes[i].getIDMapping();
                    ScalarExpression targetElementExpr =
                        targetElementMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
                    targetSubElementTypeExpr = targetMapping.newScalarExpression(stmt, teTargetSubElementType);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.