public Column(DBIdentifier name, Table table) { setIdentifier(name); if (table != null) { setTableIdentifier(table.getIdentifier()); setSchemaIdentifier(table.getSchemaIdentifier()); } _table = table; }
/** 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); } }
/** * Set the column's name. You can only call this method on columns whose table object is not set. * * @deprecated use setIdentifier(DBIdentifier name) */ public void setName(String name) { setIdentifier(DBIdentifier.newColumn(name)); }