Package org.apache.openjpa.jdbc.schema

Examples of org.apache.openjpa.jdbc.schema.ForeignKey.join()


        Column c4 = table2.addColumn("c4");
        PrimaryKey pk = table2.addPrimaryKey("pk");
        pk.addColumn(c3);
        pk.addColumn(c4);
        ForeignKey fk = table.addForeignKey("fk");
        fk.join(c1, c3);
        fk.join(c2, c4);

        table2.removePrimaryKey();
        assertNull(pk.getTable());
        assertNull(table2.getPrimaryKey());
View Full Code Here


        PrimaryKey pk = table2.addPrimaryKey("pk");
        pk.addColumn(c3);
        pk.addColumn(c4);
        ForeignKey fk = table.addForeignKey("fk");
        fk.join(c1, c3);
        fk.join(c2, c4);

        table2.removePrimaryKey();
        assertNull(pk.getTable());
        assertNull(table2.getPrimaryKey());
        assertEquals(0, table.getForeignKeys().length);
View Full Code Here

        Column c3 = table2.addColumn("c3");
        Column c4 = table2.addColumn("c4");
        pk = table2.addPrimaryKey("pk2");
        pk.addColumn(c3);
        ForeignKey fk = table.addForeignKey("fk");
        fk.join(c1, c3);

        table.removeColumn(c1);
        assertNull(table.getPrimaryKey());
        assertNull(table.getIndex("idx1"));
        assertEquals(1, idx2.getColumns().length);
View Full Code Here

            tcol = gcols[i];
            if (gfk != null)
                tcol = gfk.getColumn(tcol);
            if (tfk == null)
                tfk = new ForeignKey(DBIdentifier.NULL, tcol.getTable());
            tfk.join(tcol, fk.getPrimaryKeyColumn(cols[i]));
        }
        return tfk;
    }

    public Object getJoinValue(Object fieldVal, Column col, JDBCStore store) {
View Full Code Here

            tcol = gcols[i];
            if (gfk != null)
                tcol = gfk.getColumn(tcol);
            if (tfk == null)
                tfk = new ForeignKey(null, tcol.getTable());
            tfk.join(tcol, fk.getPrimaryKeyColumn(cols[i]));
        }
        return tfk;
    }

    public Object getJoinValue(Object fieldVal, Column col, JDBCStore store) {
View Full Code Here

            tcol = gcols[i];
            if (gfk != null)
                tcol = gfk.getColumn(tcol);
            if (tfk == null)
                tfk = new ForeignKey(DBIdentifier.NULL, tcol.getTable());
            tfk.join(tcol, fk.getPrimaryKeyColumn(cols[i]));
        }
        return tfk;
    }

    public Object getJoinValue(Object fieldVal, Column col, JDBCStore store) {
View Full Code Here

        // add joins to key
        Column col;
        for (int i = 0; i < joins.length; i++) {
            col = (Column) joins[i][0];
            if (joins[i][1]instanceof Column)
                fk.join(col, (Column) joins[i][1]);
            else if ((joins[i][2] == Boolean.TRUE) != (_join == JOIN_INVERSE))
                fk.joinConstant(joins[i][1], col);
            else
                fk.joinConstant(col, joins[i][1]);
        }
View Full Code Here

            tcol = gcols[i];
            if (gfk != null)
                tcol = gfk.getColumn(tcol);
            if (tfk == null)
                tfk = new ForeignKey(null, tcol.getTable());
            tfk.join(tcol, fk.getPrimaryKeyColumn(cols[i]));
        }
        return tfk;
    }

    public Object getJoinValue(Object fieldVal, Column col, JDBCStore store) {
View Full Code Here

            tcol = gcols[i];
            if (gfk != null)
                tcol = gfk.getColumn(tcol);
            if (tfk == null)
                tfk = new ForeignKey(null, tcol.getTable());
            tfk.join(tcol, fk.getPrimaryKeyColumn(cols[i]));
        }
        return tfk;
    }

    public Object getJoinValue(Object fieldVal, Column col, JDBCStore store) {
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.