Examples of newForeignKey()


Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

     Column referenceColumn = otherTable.newColumn("RefIndex", Column.Type.INTEGER);
     Column companyColumn = otherTable.newColumn("Company", Column.Type.VARCHAR);
     ((StringColumn) companyColumn).setLength(60);
     otherTable.newPrimaryKey().addColumn(otherIndex);

     ForeignKey reference = otherTable.newForeignKey(pTable);
     reference.addColumnLink(referenceColumn, pTable.getColumn("MyIndex"));
     return otherTable;
  }

  /** <p>Basic test for creating a <code>CREATE TABLE</code>
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

    Table table = getComposedKeyTable();

    Table otherTable = table.getSchema().newTable("OtherTable");
    Column otherIndex = otherTable.newColumn("MyIndex", Column.Type.INTEGER);
    otherTable.newPrimaryKey().addColumn(otherIndex);
    ForeignKey foreignKey = otherTable.newForeignKey(table);
    SelectStatement selectStatement = sqlFactory.newSelectStatement();
    selectStatement.setTable(otherTable);
    DeleteStatement deleteStatement = sqlFactory.newDeleteStatement();
    deleteStatement.setTable(table);
    List columns = new ArrayList();
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

      stEmail.setNullable(true);

      Index primaryKey = st.newPrimaryKey();
      primaryKey.addColumn(stId);

      ForeignKey foreignKey = st.newForeignKey(getMainTable());
      foreignKey.addColumnLink(stMtId, getMainTable().getColumn("ID"));
      foreignKey.addColumnLink(stMtVer, getMainTable().getColumn("VER"));

      subTable = st;
    }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

        StringColumn sstId = (StringColumn) sst.newColumn("ID", Column.Type.VARCHAR);
        sstId.setLength(32);

        Column sstMtId = sst.newColumn("MTID", Column.Type.BIGINT);
        Column sstMtVer = sst.newColumn("MTVER", Column.Type.INTEGER);
        ForeignKey foreignKeySt = sst.newForeignKey(getMainTable());
        foreignKeySt.addColumnLink(sstMtId, getMainTable().getColumn("ID"));
        foreignKeySt.addColumnLink(sstMtVer, getMainTable().getColumn("VER"));

        StringColumn sstStId = (StringColumn) sst.newColumn("SSTID", Column.Type.VARCHAR);
        sstStId.setLength(32);
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

        foreignKeySt.addColumnLink(sstMtId, getMainTable().getColumn("ID"));
        foreignKeySt.addColumnLink(sstMtVer, getMainTable().getColumn("VER"));

        StringColumn sstStId = (StringColumn) sst.newColumn("SSTID", Column.Type.VARCHAR);
        sstStId.setLength(32);
        ForeignKey foreignKeySst = sst.newForeignKey(getSubTable());
        foreignKeySst.addColumnLink(sstStId, getSubTable().getColumn("ID"));

        sst.newColumn("MTTS", Column.Type.TIMESTAMP);
     }
     return subsubTable;
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

      StringColumn sstId = (StringColumn) sst.newColumn("ID", Column.Type.VARCHAR);
      sstId.setLength(32);
     
      Column sstMtId = sst.newColumn("MTID", Column.Type.BIGINT);
      Column sstMtVer = sst.newColumn("MTVER", Column.Type.INTEGER);
      ForeignKey foreignKeySt = sst.newForeignKey(getMainTable());
      foreignKeySt.addColumnLink(sstMtId, getMainTable().getColumn("ID"));
      foreignKeySt.addColumnLink(sstMtVer, getMainTable().getColumn("VER"));
     
      StringColumn sstStId = (StringColumn) sst.newColumn("SSTID", Column.Type.VARCHAR);
      sstStId.setLength(32);
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

      foreignKeySt.addColumnLink(sstMtId, getMainTable().getColumn("ID"));
      foreignKeySt.addColumnLink(sstMtVer, getMainTable().getColumn("VER"));
     
      StringColumn sstStId = (StringColumn) sst.newColumn("SSTID", Column.Type.VARCHAR);
      sstStId.setLength(32);
      ForeignKey foreignKeySst = sst.newForeignKey(getSubTable());
      foreignKeySst.addColumnLink(sstStId, getSubTable().getColumn("ID"));
     
      sst.newColumn("MTTS", Column.Type.TIMESTAMP);
    }
    return subsubTable;
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

      stEmail.setNullable(true);
     
      Index primaryKey = st.newPrimaryKey();
      primaryKey.addColumn(stId);
     
      ForeignKey foreignKey = st.newForeignKey(getMainTable());
      foreignKey.addColumnLink(stMtId, getMainTable().getColumn("ID"));
      foreignKey.addColumnLink(stMtVer, getMainTable().getColumn("VER"));
     
      subTable = st;
    }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

        Column referenceColumn = otherTable.newColumn("RefIndex", Column.Type.INTEGER);
        Column companyColumn = otherTable.newColumn("Company", Column.Type.VARCHAR);
        ((StringColumn) companyColumn).setLength(60);
        otherTable.newPrimaryKey().addColumn(otherIndex);
       
        ForeignKey reference = otherTable.newForeignKey(pTable);
        reference.addColumnLink(referenceColumn, pTable.getColumn("MyIndex"));
        return otherTable;
    }
   
    /** <p>Basic test for creating a <code>CREATE TABLE</code>
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.Table.newForeignKey()

        Table table = getComposedKeyTable();
       
        Table otherTable = table.getSchema().newTable("OtherTable");
        Column otherIndex = otherTable.newColumn("MyIndex", Column.Type.INTEGER);
        otherTable.newPrimaryKey().addColumn(otherIndex);
        ForeignKey foreignKey = otherTable.newForeignKey(table);
        SelectStatement selectStatement = sqlFactory.newSelectStatement();
        selectStatement.setTable(otherTable);
        DeleteStatement deleteStatement = sqlFactory.newDeleteStatement();
        deleteStatement.setTable(table);
        List columns = new ArrayList();
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.