Package org.apache.openjpa.jdbc.schema

Examples of org.apache.openjpa.jdbc.schema.Table.addColumn()


    public void testForeignKey() {
        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        Table table2 = _schema.addTable("table2");
        Column c3 = table2.addColumn("c3");
        Column c4 = table2.addColumn("c4");

        ForeignKey fk = table.addForeignKey("fk");
        try {
            fk.join(c4, c2);
View Full Code Here


        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        Table table2 = _schema.addTable("table2");
        Column c3 = table2.addColumn("c3");
        Column c4 = table2.addColumn("c4");

        ForeignKey fk = table.addForeignKey("fk");
        try {
            fk.join(c4, c2);
            fail("Allowed addition of column of another table.");
View Full Code Here

    /**
     * Test primary key removal.
     */
    public void testPrimaryKeyRemoval() {
        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        Table table2 = _schema.addTable("table2");
        Column c3 = table2.addColumn("c3");
        Column c4 = table2.addColumn("c4");
        PrimaryKey pk = table2.addPrimaryKey("pk");
View Full Code Here

     * Test primary key removal.
     */
    public void testPrimaryKeyRemoval() {
        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        Table table2 = _schema.addTable("table2");
        Column c3 = table2.addColumn("c3");
        Column c4 = table2.addColumn("c4");
        PrimaryKey pk = table2.addPrimaryKey("pk");
        pk.addColumn(c3);
View Full Code Here

    public void testPrimaryKeyRemoval() {
        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        Table table2 = _schema.addTable("table2");
        Column c3 = table2.addColumn("c3");
        Column c4 = table2.addColumn("c4");
        PrimaryKey pk = table2.addPrimaryKey("pk");
        pk.addColumn(c3);
        pk.addColumn(c4);
        ForeignKey fk = table.addForeignKey("fk");
View Full Code Here

        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        Table table2 = _schema.addTable("table2");
        Column c3 = table2.addColumn("c3");
        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);
View Full Code Here

    /**
     * Test column removal.
     */
    public void testColumnRemoval() {
        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        PrimaryKey pk = table.addPrimaryKey("pk");
        pk.addColumn(c1);
        Index idx1 = table.addIndex("idx1");
        idx1.addColumn(c1);
View Full Code Here

     * Test column removal.
     */
    public void testColumnRemoval() {
        Table table = _schema.addTable("table");
        Column c1 = table.addColumn("c1");
        Column c2 = table.addColumn("c2");
        PrimaryKey pk = table.addPrimaryKey("pk");
        pk.addColumn(c1);
        Index idx1 = table.addIndex("idx1");
        idx1.addColumn(c1);
        Index idx2 = table.addIndex("idx2");
View Full Code Here

        Index idx2 = table.addIndex("idx2");
        idx2.addColumn(c1);
        idx2.addColumn(c2);

        Table table2 = _schema.addTable("table2");
        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);
View Full Code Here

        idx2.addColumn(c1);
        idx2.addColumn(c2);

        Table table2 = _schema.addTable("table2");
        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);
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.