コード例 #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;
        }
      }
    }
  }
コード例 #2
0
  public List<IntrospectedColumn> getNonPrimaryKeyColumns() {
    List<IntrospectedColumn> answer = new ArrayList<IntrospectedColumn>();
    answer.addAll(baseColumns);
    answer.addAll(blobColumns);

    return answer;
  }
コード例 #3
0
  public void addColumn(IntrospectedColumn introspectedColumn) {
    if (introspectedColumn.isBLOBColumn()) {
      blobColumns.add(introspectedColumn);
    } else {
      baseColumns.add(introspectedColumn);
    }

    introspectedColumn.setIntrospectedTable(this);
  }
コード例 #4
0
 public boolean hasAnyColumns() {
   return primaryKeyColumns.size() > 0 || baseColumns.size() > 0 || blobColumns.size() > 0;
 }
コード例 #5
0
 public boolean hasBaseColumns() {
   return baseColumns.size() > 0;
 }
コード例 #6
0
 public boolean hasBLOBColumns() {
   return blobColumns.size() > 0;
 }
コード例 #7
0
 public int getNonBLOBColumnCount() {
   return primaryKeyColumns.size() + baseColumns.size();
 }
コード例 #8
0
 public boolean hasPrimaryKeyColumns() {
   return primaryKeyColumns.size() > 0;
 }