Package org.apache.tuscany.das.rdb.config

Examples of org.apache.tuscany.das.rdb.config.Column


            return true;
        } else {
            Table t = mappingWrapper.getTable(getTablePropertyName(i));
            if (t == null)
                return true;
            Column c = mappingWrapper.getColumn(t, getDatabaseColumnName(i));

            if (c == null)
                return false;

            if (c.isPrimaryKey())
                return true;
        }
        return false;
    }
View Full Code Here


        if (mappingWrapper.getConfig() == null)
            return false;
        Table t = mappingWrapper.getTable(getTableName());
        if (t == null)
            return false;
        Column c = mappingWrapper.getColumnByPropertyName(t, parameter);
        if (c == null)
            return false;
        return c.isPrimaryKey();
    }
View Full Code Here

  public Collection getPrimaryKeyNames() {
    ArrayList pkNames = new ArrayList();
    Iterator i = table.getColumn().iterator();
    while (i.hasNext()) {
      Column c = (Column) i.next();
      if (c.isPrimaryKey())
        pkNames.add(c.getName());
    }
    return pkNames;
  }
View Full Code Here

  public Collection getPrimaryKeyProperties() {

    ArrayList keyProperties = new ArrayList();
    Iterator columns = table.getColumn().iterator();
    while (columns.hasNext()) {
      Column c = (Column) columns.next();
      if (c.isPrimaryKey()) {
        keyProperties.add(getColumnPropertyName(c));
      }
    }

    return keyProperties;
View Full Code Here

    else
      return c.getName();
  }

  public boolean isGeneratedColumnProperty(String name) {
    Column c = getColumnByPropertyName(name);
    return c == null ? false : c.isGenerated();
  }
View Full Code Here

  // }
  // return propertyName;
  // }

  public String getConverter(String propertyName) {
    Column c = getColumnByPropertyName(propertyName);
    return (c == null) ? null : c.getConverterClassName();
  }
View Full Code Here

  }

  public Column getColumnByPropertyName(String propertyName) {
    Iterator columns = table.getColumn().iterator();
    while (columns.hasNext()) {
      Column c = (Column) columns.next();
      String property = c.getPropertyName();
      if (property == null)
        property = c.getName();
      if (propertyName.equals(property))
        return c;
    }

    return null;
View Full Code Here

  }

  public Column getCollisionColumn() {
    Iterator columns = table.getColumn().iterator();
    while (columns.hasNext()) {
      Column c = (Column) columns.next();
      if ( c.isCollision() )
        return c;
    }

    return null;
View Full Code Here

    return null;

  }

  public String getCollisionColumnPropertyName() {
    Column c = getCollisionColumn();
    if ( c.getPropertyName() != null )
      return c.getPropertyName();
    else
      return c.getName();
  }
View Full Code Here

    Iterator i = mapping.getConfig().getTable().iterator();
    while (i.hasNext()) {
      Table t = (Table) i.next();
      Iterator columns = t.getColumn().iterator();
      while ( columns.hasNext()) {
        Column c = (Column) columns.next();
        if ( c.isPrimaryKey() && c.isGenerated()) {
          DebugUtil.debugln(getClass(), debug, "adding generated key "
              + t.getName() + "."
              + c.getName());
          generatedKeys.put(t.getName(), c.getName());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.das.rdb.config.Column

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.