private Column timeColumn(String name) {
   Column c = new Column();
   c.setName(name);
   c.setType(Types.TIME);
   c.setJavaType(JavaTypes.DATE);
   return c;
 }
 private Column dayColumn(String name) {
   Column c = new Column();
   c.setName(name + "_day");
   c.setType(Types.DATE);
   c.setJavaType(JavaTypes.DATE);
   return c;
 }
Esempio n. 3
0
  /** 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;
  }
Esempio n. 4
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);
   }
 }