Exemplo n.º 1
0
  public void addPrimaryKeyColumn(String columnName) {
    boolean found = false;
    // first search base columns
    Iterator<IntrospectedColumn> iter = baseColumns.iterator();
    while (iter.hasNext()) {
      IntrospectedColumn introspectedColumn = iter.next();
      if (introspectedColumn.getActualColumnName().equals(columnName)) {
        primaryKeyColumns.add(introspectedColumn);
        iter.remove();
        found = true;
        break;
      }
    }

    // search blob columns in the weird event that a blob is the primary key
    if (!found) {
      iter = blobColumns.iterator();
      while (iter.hasNext()) {
        IntrospectedColumn introspectedColumn = iter.next();
        if (introspectedColumn.getActualColumnName().equals(columnName)) {
          primaryKeyColumns.add(introspectedColumn);
          iter.remove();
          found = true;
          break;
        }
      }
    }
  }
Exemplo n.º 2
0
  public List<IntrospectedColumn> getNonPrimaryKeyColumns() {
    List<IntrospectedColumn> answer = new ArrayList<IntrospectedColumn>();
    answer.addAll(baseColumns);
    answer.addAll(blobColumns);

    return answer;
  }
Exemplo n.º 3
0
  public void addColumn(IntrospectedColumn introspectedColumn) {
    if (introspectedColumn.isBLOBColumn()) {
      blobColumns.add(introspectedColumn);
    } else {
      baseColumns.add(introspectedColumn);
    }

    introspectedColumn.setIntrospectedTable(this);
  }
Exemplo n.º 4
0
 public boolean hasAnyColumns() {
   return primaryKeyColumns.size() > 0 || baseColumns.size() > 0 || blobColumns.size() > 0;
 }
Exemplo n.º 5
0
 public boolean hasBaseColumns() {
   return baseColumns.size() > 0;
 }
Exemplo n.º 6
0
 public boolean hasBLOBColumns() {
   return blobColumns.size() > 0;
 }
Exemplo n.º 7
0
 public int getNonBLOBColumnCount() {
   return primaryKeyColumns.size() + baseColumns.size();
 }
Exemplo n.º 8
0
 public boolean hasPrimaryKeyColumns() {
   return primaryKeyColumns.size() > 0;
 }