コード例 #1
0
ファイル: Column.java プロジェクト: kasungayan/commons
  /** Tests compatibility. */
  public boolean equalsColumn(Column col) {
    if (col == this) return true;
    if (col == null) return false;

    if (!getQualifiedPath().equals(col.getQualifiedPath())) return false;
    if (!isCompatible(
        col.getType(), col.getTypeIdentifier().getName(), col.getSize(), col.getDecimalDigits()))
      return false;
    if (getType() == Types.VARCHAR
        && getSize() > 0
        && col.getSize() > 0
        && getSize() != col.getSize()) return false;
    return true;
  }
コード例 #2
0
ファイル: Column.java プロジェクト: kasungayan/commons
 /** Copy information from the given column to this one. */
 public void copy(Column from) {
   if (from == null) return;
   if (DBIdentifier.isNull(getIdentifier())) setIdentifier(from.getIdentifier());
   if (getType() == Types.OTHER) setType(from.getType());
   if (DBIdentifier.isNull(getTypeIdentifier())) setTypeIdentifier(from.getTypeIdentifier());
   if (getJavaType() == JavaTypes.OBJECT) setJavaType(from.getJavaType());
   if (getSize() == 0) setSize(from.getSize());
   if (getDecimalDigits() == 0) setDecimalDigits(from.getDecimalDigits());
   if (getDefaultString() == null) setDefaultString(from.getDefaultString());
   if (!isNotNullExplicit() && from.isNotNullExplicit()) setNotNull(from.isNotNull());
   if (!isAutoAssigned()) setAutoAssigned(from.isAutoAssigned());
   if (!isRelationId()) setRelationId(from.isRelationId());
   if (!isImplicitRelation()) setImplicitRelation(from.isRelationId());
   if (DBIdentifier.isNull(getTargetIdentifier())) setTargetIdentifier(from.getTargetIdentifier());
   if (getTargetField() == null) setTargetField(from.getTargetField());
   if (_flags == 0) _flags = from._flags;
   if (!isXML()) setXML(from.isXML());
   if (!isUni1MFK()) setUni1MFK(from.isUni1MFK());
   for (Constraint c : _constraints) {
     addConstraint(c);
   }
 }