public void createDbAttribute(DataMap map, DbEntity dbEntity, DbAttribute attr) { dbEntity.addAttribute(attr); ProjectController mediator = getProjectController(); fireDbAttributeEvent(this, mediator, map, dbEntity, attr); }
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)); } String precision = atts.getValue("", "precision"); if (precision != null) { attrib.setPrecision(Integer.parseInt(precision)); } attrib.setPrimaryKey(TRUE.equalsIgnoreCase(atts.getValue("", "isPrimaryKey"))); attrib.setMandatory(TRUE.equalsIgnoreCase(atts.getValue("", "isMandatory"))); attrib.setGenerated(TRUE.equalsIgnoreCase(atts.getValue("", "isGenerated"))); }
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"))); }
private void processStartDerivedDbAttribute(Attributes atts) { String name = atts.getValue("", "name"); String type = atts.getValue("", "type"); String spec = atts.getValue("", "spec"); attrib = new DerivedDbAttribute(name); attrib.setType(TypesMapping.getSqlTypeByName(type)); ((DerivedDbAttribute) attrib).setExpressionSpec(spec); dbEntity.addAttribute(attrib); String temp = atts.getValue("", "length"); if (temp != null) { attrib.setMaxLength(Integer.parseInt(temp)); } temp = atts.getValue("", "precision"); if (temp != null) { attrib.setPrecision(Integer.parseInt(temp)); } temp = atts.getValue("", "isPrimaryKey"); if (temp != null && temp.equalsIgnoreCase(TRUE)) { attrib.setPrimaryKey(true); } temp = atts.getValue("", "isMandatory"); if (temp != null && temp.equalsIgnoreCase(TRUE)) { attrib.setMandatory(true); } temp = atts.getValue("", "isGroupBy"); if (temp != null && temp.equalsIgnoreCase(TRUE)) { ((DerivedDbAttribute) attrib).setGroupBy(true); } }
private void addToDbEntity(DbEntity entity, DbAttribute attribute) { attribute.setEntity(entity); // override existing attributes if it comes again if (entity.getAttribute(attribute.getName()) != null) { entity.removeAttribute(attribute.getName()); } entity.addAttribute(attribute); }
.getSqlTypeByJava(javaType), dbEntity); dbAttr.setEoAttributeName(attrName); dbEntity.addAttribute(dbAttr);
allowNulls); attr.setEntity(dbEntity); dbEntity.addAttribute(attr);
dbEntity.addAttribute(dbAttr);
@Override public void execute(MergerContext mergerContext) { getEntity().addAttribute(getColumn()); for (ObjEntity e : getMappedObjEntities()) { mergerContext.getEntityMergeSupport().synchronizeOnDbAttributeAdded(e, getColumn()); } mergerContext.getDelegate().dbAttributeAdded(getColumn()); }
.name()); dbEntity.addAttribute(attr); CreateAttributeAction.fireDbAttributeEvent(this, mediator, mediator .getCurrentDataMap(), dbEntity, attr);