Package org.jpox.store.mapped.expression

Examples of org.jpox.store.mapped.expression.QueryExpression.select()


                {
                    DatastoreIdentifier subclassTableIdentifier = storeMgr.getIdentifierFactory().newIdentifier(IdentifierFactory.TABLE, "SUBCLASS" + (subclasses_seq_id++));
                    QueryExpression st = storeMgr.getDatastoreAdapter().newQueryStatement(subclassTable, subclassTableIdentifier, om.getClassLoaderResolver());
                    LogicSetExpression table_expr_sub = st.newTableExpression(subclassTable, subclassTableIdentifier);
                    JavaTypeMapping subMapping = subclassTable.getIDMapping();
                    st.select(subclassTableIdentifier, subMapping);

                    ScalarExpression subExpr = subMapping.newScalarExpression(qs, table_expr_sub);
                    ScalarExpression schExpr =
                        (((DatastoreClass)schemaDataOption.getDatastoreContainerObject()).getIDMapping()).newScalarExpression(
                            qs,qs.getMainTableExpression());
View Full Code Here


        ScalarExpression ownerExpr = ownerMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
        ScalarExpression ownerVal = ownerMapping.newLiteral(stmt, sm.getObject());
        stmt.andCondition(ownerExpr.eq(ownerVal));

        // Select the element table ID mapping
        stmt.select(elementMapping);

        return stmt;
    }

    /**
 
View Full Code Here

        ScalarExpression ownerExpr = ownerMapping.newScalarExpression(stmt, stmt.getMainTableExpression());
        ScalarExpression ownerVal = ownerMapping.newLiteral(stmt, sm.getObject());
        stmt.andCondition(ownerExpr.eq(ownerVal));

        // Select the element table ID mapping
        stmt.select(elementMapping);

        return stmt;
    }

    /**
 
View Full Code Here

    {
        if (storeMgr.getOMFContext().getTypeManager().isSupportedType(candidateFullClassName))
        {
            // SCO candidates, embedded in the source so just select the source table
            QueryExpression qs = dba.newQueryStatement(sourceTable, candidateAlias, clr);
            qs.select(sourceMapping);
            return qs;
        }
        else
        {
            // FCO candidates
View Full Code Here

        ScalarExpression ownerExpr = mapping.newScalarExpression(stmt, ownerTe);
        ScalarExpression ownerInCollectionExpr = ownerMapping.newScalarExpression(stmt, stmt.getTableExpression(collectionTableAlias));
        stmt.andCondition(ownerExpr.eq(ownerInCollectionExpr));

        // Select id mapping of element
        stmt.select(collectionTableAlias, elementMapping);

        return stmt;
    }

    /**
 
View Full Code Here

            discrimTableExpr = stmt.getMainTableExpression();

            if (hasDiscriminator && selectDiscriminator)
            {
                // Select the discriminator column so we can process the ResultSet
                stmt.select(discriminatorMapping);
            }
        }

        // Check if we can omit the discriminator restriction
        if (includeSubclasses && hasDiscriminator && candidateTable.getDiscriminatorMapping(false) != null &&
View Full Code Here

        // Join to the owner
        ScalarExpression ownerExpr = mapping.newScalarExpression(stmt, ownerTe);
        ScalarExpression ownerInMapExpr = ownerMapping.newScalarExpression(stmt, stmt.getTableExpression(mapTableAlias));
        stmt.andCondition(ownerExpr.eq(ownerInMapExpr));

        stmt.select(mapTableAlias, valueMapping);

        return stmt;
    }

    /**
 
View Full Code Here

        QueryExpression stmt = null;
        final ClassLoaderResolver clr=ownerSm.getObjectManager().getClassLoaderResolver();
        if (valuesAreEmbedded || valuesAreSerialised)
        {
            stmt = dba.newQueryStatement(mapTable, clr);
            stmt.select(valueMapping);
        }
        else
        {
            // Value = PC
            stmt = new UnionIteratorStatement(clr, clr.classForName(this.valueType), true, this.storeMgr,
View Full Code Here

        stmt.andCondition(ownerExpr.eq(ownerVal), true);

        if (storeMgr.getOMFContext().getTypeManager().isSupportedType(candidateClass))
        {
            // Non-PC(embedded) - select the join table value
            stmt.select(mapTableAlias, valueMapping);
        }
        else
        {
            // PC - Join the value table on the value ID column
            DatastoreClass candidateTable = storeMgr.getDatastoreClass(candidateClass, clr);
View Full Code Here

            ScalarExpression valueExpr = valueTableID.newScalarExpression(stmt,
                stmt.getMainTableExpression());
            stmt.innerJoin(valueExpr, valueMapExpr, stmt.getMainTableExpression(), true, true);

            // Select the ID of the value table
            stmt.select(valueTableID);
        }

        return stmt;
    }
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.