private void processStartDbAttribute(Attributes atts) { String name = atts.getValue("", "name"); String type = atts.getValue("", "type"); attrib = new DbAttribute(name); attrib.setType(TypesMapping.getSqlTypeByName(type)); dbEntity.addAttribute(attrib); String length = atts.getValue("", "length"); if (length != null) { attrib.setMaxLength(Integer.parseInt(length)); } // this is an obsolete 1.2 'precision' attribute that really meant // 'scale' String pseudoPrecision = atts.getValue("", "precision"); if (pseudoPrecision != null) { attrib.setScale(Integer.parseInt(pseudoPrecision)); } String precision = atts.getValue("", "attributePrecision"); if (precision != null) { attrib.setAttributePrecision(Integer.parseInt(precision)); } String scale = atts.getValue("", "scale"); if (scale != null) { attrib.setScale(Integer.parseInt(scale)); } attrib.setPrimaryKey(TRUE.equalsIgnoreCase(atts.getValue("", "isPrimaryKey"))); attrib.setMandatory(TRUE.equalsIgnoreCase(atts.getValue("", "isMandatory"))); attrib.setGenerated(TRUE.equalsIgnoreCase(atts.getValue("", "isGenerated"))); }
@Override public void execute(MergerContext mergerContext) { columnOriginal.setType(columnNew.getType()); columnOriginal.setMaxLength(columnNew.getMaxLength()); columnOriginal.setAttributePrecision(columnNew.getAttributePrecision()); columnOriginal.setScale(columnNew.getScale()); mergerContext.getDelegate().dbAttributeModified(columnOriginal); }