Package org.apache.ws.jaxme.sqls

Examples of org.apache.ws.jaxme.sqls.Schema


        throw new NullPointerException("Missing 'verColumn' attribute");
      }
      Column.Name columnName = new ColumnImpl.NameImpl(getVerColumn());

      SQLFactory factory = new SQLFactoryImpl();
      Schema sch = factory.getSchema(getConnection(), getSchema());

      VersionGenerator versionGenerator = new VersionGenerator();
      versionGenerator.setGeneratingLogging(isGeneratingLogging());
      boolean isFirstTable = true;

      for (Iterator iter = myTables.iterator();  iter.hasNext()) {
        String tableName = (String) iter.next();
        Table table = sch.getTable(tableName);
        if (table == null) {
          throw new IllegalArgumentException("Invalid table name: " + tableName);
        }

        VersionGenerator.ColumnUpdater columnUpdater;
View Full Code Here


    if (maxLength != null  &&
  pName.getName().length() > maxLength.intValue()) {
      throw new IllegalArgumentException("The length of the schema name " + pName +
           " exceeds the valid maximum of " + maxLength);
    }
    Schema schema = getSchema(pName);
    if (schema != null) {
      throw new IllegalStateException("A schema named " + schema.getName() + " already exists.")
    }
    schema = newSchemaImpl(pName);
    schemas.add(schema);
    return schema;
  }
View Full Code Here

  public Schema getSchema(Schema.Name pName) {
    if (pName == null) {
      throw new NullPointerException("A schema name must not be null.");
    }
    for (Iterator iter = getSchemas(); iter.hasNext();) {
      Schema schema = (Schema) iter.next();
      if (isSchemaNameCaseSensitive()) {
        if (pName.getName().equalsIgnoreCase(schema.getName().getName())) {
          return schema;
        }
      } else {
        if (pName.equals(schema.getName())) {
          return schema;
        }
      }
    }
    return null;
View Full Code Here

      }
    }
  }

  protected Schema makeSchema(Schema.Name pName) {
    Schema schema;
    if (pName == null) {
       schema = getDefaultSchema();
    } else {
       schema = getSchema(pName);
       if (schema == null) {
View Full Code Here

  public Schema getSchema(Connection pConn, Schema.Name pName) throws SQLException {
    final String mName = "getSchema(Connection,Schema.Name)";
    logger.finest(mName, "->", new Object[]{pConn, pName});

    Schema schema = makeSchema(pName);
    DatabaseMetaData metaData = pConn.getMetaData();
    JDBCTable[] tables = readTables(metaData, pName, null);
    for (int i = 0;  i < tables.length;  i++) {
      readTable(metaData, schema, tables[i]);
      readPrimaryKey(metaData, tables[i]);
View Full Code Here

  public Table getTable(Connection pConnection, Schema.Name pSchema, Table.Name pTable) throws SQLException {
    final String mName = "getSchema(Connection,Schema.Name)";
    logger.finest(mName, "->", new Object[]{pConnection, pSchema, pTable});

    Schema schema = makeSchema(pSchema);
    DatabaseMetaData metaData = pConnection.getMetaData();
    JDBCTable[] tables = readTables(metaData, pSchema, pTable);
    JDBCTable jdbcTable;
    if (tables.length == 0) {
      String tableName = pTable.toString();
View Full Code Here

  public Table.Name getName() {
      return name;
  }

   public String getQName() {
      Schema mySchema = getSchema();
      if (mySchema.getName() == null) {
         return getName().getName();
      } else {
         return mySchema.getName().getName() + "." + getName().getName();
      }
   }
View Full Code Here

   public boolean equals(Object o) {
      if (o == null  ||  !(o instanceof Schema)) {
         return false;
      }
      Schema other = (Schema) o;
      if (getName() == null) {
         return other.getName() == null;
      } else {
         return getName().equals(other.getName());
      }
   }
View Full Code Here

        throw new NullPointerException("Missing 'verColumn' attribute");
      }
      Column.Name columnName = new ColumnImpl.NameImpl(getVerColumn());

      SQLFactory factory = new SQLFactoryImpl();
      Schema sch = factory.getSchema(getConnection(), getSchema());

      VersionGenerator versionGenerator = new VersionGenerator();
      versionGenerator.setGeneratingLogging(isGeneratingLogging());
      boolean isFirstTable = true;

      for (Iterator iter = myTables.iterator();  iter.hasNext()) {
        String tableName = (String) iter.next();
        Table table = sch.getTable(tableName);
        if (table == null) {
          throw new IllegalArgumentException("Invalid table name: " + tableName);
        }

        VersionGenerator.ColumnUpdater columnUpdater;
View Full Code Here

  public Table.Name getName() {
      return name;
  }

   public String getQName() {
      Schema mySchema = getSchema();
      if (mySchema.getName() == null) {
         return getName().getName();
      } else {
         return mySchema.getName().getName() + "." + getName().getName();
      }
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.sqls.Schema

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.