Package org.jpox.store.rdbms.table

Examples of org.jpox.store.rdbms.table.MapTable


            {
                join = new CollectionTable(tableName, fmd, RDBMSManager.this);
            }
            else if (type == JOIN_TABLE_MAP)
            {
                join = new MapTable(tableName, fmd, RDBMSManager.this);
            }
            else if (type == JOIN_TABLE_ARRAY)
            {
                join = new ArrayTable(tableName, fmd, RDBMSManager.this);
            }
View Full Code Here


                            "050036", im.subfieldName, im));
                    }
                }
                else if (t instanceof MapTable)
                {
                    MapTable mt = (MapTable) t;
                    if (im.subfieldName.equals("owner"))
                    {
                        m = mt.getOwnerMapping();
                    }
                    else if (im.subfieldName.equals("key"))
                    {
                        m = mt.getKeyMapping();
                    }
                    else if (im.subfieldName.equals("value"))
                    {
                        m = mt.getValueMapping();
                    }
                    else
                    {
                        throw new JPOXUserException(LOCALISER_RDBMS.msg(
                                "050037",
View Full Code Here

                        leftCentreExpr = joinTbl.getOwnerMapping().newScalarExpression(qs, joinTblExpr);
                        rightCentreExpr = joinTbl.getElementMapping().newScalarExpression(qs, joinTblExpr);
                    }
                    else if (leftMmd.hasMap())
                    {
                        MapTable joinTbl = (MapTable)storeMgr.getDatastoreContainerObject(leftMmd);
                        DatastoreIdentifier joinTblAlias = storeMgr.getIdentifierFactory().newIdentifier(
                            IdentifierFactory.TABLE, leftAlias + "." + rightAlias);
                        joinTblExpr = qs.newTableExpression(joinTbl, joinTblAlias);
                        leftCentreExpr = joinTbl.getOwnerMapping().newScalarExpression(qs, joinTblExpr);
                        rightCentreExpr = joinTbl.getValueMapping().newScalarExpression(qs, joinTblExpr);
                    }

                    if (i == 1)
                    {
                        // And condition to outer candidate
                        qs.andCondition(leftExpr.eq(leftCentreExpr), true);
                    }
                    else
                    {
                        // Inner join to table
                        qs.innerJoin(leftCentreExpr, leftExpr, leftTblExpr, true, true);
                    }
                    qs.innerJoin(rightExpr, rightCentreExpr, joinTblExpr, true, true);
                }
                else if ((relationType == Relation.ONE_TO_MANY_BI &&
                    (leftMmd.getJoinMetaData() != null || rightMmd.getJoinMetaData() != null)) ||
                    (relationType == Relation.MANY_TO_ONE_BI &&
                     (leftMmd.getJoinMetaData() != null || rightMmd.getJoinMetaData() != null)) ||
                     relationType == Relation.MANY_TO_MANY_BI)
                {
                    // 1-N/N-1 bi JoinTable
                    ScalarExpression leftExpr = leftTable.getIDMapping().newScalarExpression(qs, leftTblExpr);
                    ScalarExpression rightExpr = rightTable.getIDMapping().newScalarExpression(qs, rightTblExpr);
                    ScalarExpression leftCentreExpr = null;
                    ScalarExpression rightCentreExpr = null;
                    LogicSetExpression joinTblExpr = null;
                    if (leftMmd.hasCollection() || rightMmd.hasCollection())
                    {
                        CollectionTable joinTbl = (CollectionTable)storeMgr.getDatastoreContainerObject(leftMmd);
                        DatastoreIdentifier joinTblAlias = storeMgr.getIdentifierFactory().newIdentifier(
                            IdentifierFactory.TABLE, leftAlias + "." + rightAlias);
                        joinTblExpr = qs.newTableExpression(joinTbl, joinTblAlias);
                        leftCentreExpr = joinTbl.getOwnerMapping().newScalarExpression(qs, joinTblExpr);
                        rightCentreExpr = joinTbl.getElementMapping().newScalarExpression(qs, joinTblExpr);
                    }
                    else if (leftMmd.hasMap() || rightMmd.hasMap())
                    {
                        MapTable joinTbl = (MapTable)storeMgr.getDatastoreContainerObject(leftMmd);
                        DatastoreIdentifier joinTblAlias = storeMgr.getIdentifierFactory().newIdentifier(
                            IdentifierFactory.TABLE, leftAlias + "." + rightAlias);
                        joinTblExpr = qs.newTableExpression(joinTbl, joinTblAlias);
                        leftCentreExpr = joinTbl.getOwnerMapping().newScalarExpression(qs, joinTblExpr);
                        rightCentreExpr = joinTbl.getValueMapping().newScalarExpression(qs, joinTblExpr);
                    }

                    if (i == 1)
                    {
                        // And condition to outer candidate
View Full Code Here

TOP

Related Classes of org.jpox.store.rdbms.table.MapTable

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.