Exemplo n.º 1
0
 /** 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);
   }
 }
Exemplo n.º 2
0
 /**
  * The name of the column this column joins to, if any. Used for mapping.
  *
  * @deprecated use setTargetIdentifier(DBIdentifier target)
  */
 public void setTarget(String target) {
   setTargetIdentifier(DBIdentifier.newColumn(StringUtils.trimToNull(target)));
 }