Package org.apache.openjpa.jdbc.schema

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


        _pkColumn = addPrimaryKeyColumn(table);
        PrimaryKey pk = table.addPrimaryKey();
        pk.addColumn(_pkColumn);

        DBDictionary dict = _conf.getDBDictionaryInstance();
        _seqColumn = table.addColumn(dict.getValidColumnName
            (_seqColumnName, table));
        _seqColumn.setType(dict.getPreferredType(Types.BIGINT));
        _seqColumn.setJavaType(JavaTypes.LONG);
    }
View Full Code Here


        _pkColumn = addPrimaryKeyColumn(table);
        PrimaryKey pk = table.addPrimaryKey();
        pk.addColumn(_pkColumn);

        DBDictionary dict = _conf.getDBDictionaryInstance();
        _seqColumn = table.addColumn(dict.getValidColumnName
            (_seqColumnName, table));
        _seqColumn.setType(dict.getPreferredType(Types.BIGINT));
        _seqColumn.setJavaType(JavaTypes.LONG);
       
        if (_uniqueColumnNames != null) {
View Full Code Here

        table.removePrimaryKey();
        assertNull(table.getPrimaryKey());
        assertTrue(!_schema.getSchemaGroup().isNameTaken("pk"));

        // column testing
        Column c2 = table.addColumn("c2");
        Column c1 = table.addColumn("c1");
        assertTrue(table.isNameTaken("c1"));
        assertTrue(!_schema.getSchemaGroup().isNameTaken("c1"));
        assertEquals(table, c1.getTable());
        Column[] cols = table.getColumns();
View Full Code Here

        assertNull(table.getPrimaryKey());
        assertTrue(!_schema.getSchemaGroup().isNameTaken("pk"));

        // column testing
        Column c2 = table.addColumn("c2");
        Column c1 = table.addColumn("c1");
        assertTrue(table.isNameTaken("c1"));
        assertTrue(!_schema.getSchemaGroup().isNameTaken("c1"));
        assertEquals(table, c1.getTable());
        Column[] cols = table.getColumns();
        assertEquals(2, cols.length);
View Full Code Here

    /**
     * Test the {@link Index} class.
     */
    public void testIndex() {
        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");

        Index idx = table.addIndex("idx");
View Full Code Here

     * Test the {@link Index} class.
     */
    public void testIndex() {
        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");

        Index idx = table.addIndex("idx");
        try {
View Full Code Here

    public void testIndex() {
        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");

        Index idx = table.addIndex("idx");
        try {
            idx.addColumn(c3);
            fail("Allowed addition of column of another table.");
View Full Code Here

    /**
     * Test the {@link ForeignKey} class.
     */
    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");

View Full Code Here

     * Test the {@link ForeignKey} class.
     */
    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");
View Full Code Here

    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

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.