private void processStartDbEntity(Attributes atts) { String name = atts.getValue("", "name"); dbEntity = new DbEntity(name); dbEntity.setSchema(atts.getValue("", "schema")); dbEntity.setCatalog(atts.getValue("", "catalog")); dataMap.addDbEntity(dbEntity); }
private void processStartDbEntity(Attributes atts) { String name = atts.getValue("", "name"); String parentName = atts.getValue("", "parentName"); if (parentName != null) { dbEntity = new DerivedDbEntity(name); ((DerivedDbEntity) dbEntity).setParentEntityName(parentName); } else { dbEntity = new DbEntity(name); } if (!(dbEntity instanceof DerivedDbEntity)) { dbEntity.setSchema(atts.getValue("", "schema")); dbEntity.setCatalog(atts.getValue("", "catalog")); } dataMap.addDbEntity(dbEntity); }
void setCatalog(String text) { if (text != null && text.trim().length() == 0) { text = null; } DbEntity ent = mediator.getCurrentDbEntity(); if (ent != null && !Util.nullSafeEquals(ent.getCatalog(), text)) { ent.setCatalog(text); mediator.fireDbEntityEvent(new EntityEvent(this, ent)); } }
/** * Constructs and returns a new DbEntity. Entity returned is added to the * DataMap. */ public void createEntity(DataMap map, DbEntity entity) { ProjectController mediator = getProjectController(); entity.setCatalog(map.getDefaultCatalog()); entity.setSchema(map.getDefaultSchema()); map.addDbEntity(entity); fireDbEntityEvent(this, mediator, entity); }
dbEntity.setName(table.getName()); dbEntity.setSchema(table.getSchema()); dbEntity.setCatalog(table.getCatalog());
protected void transformSourceBeforeMerge(DataMap sourceDataMap, DataMap targetDataMap, DbImportConfiguration configuration) { if (configuration.isForceDataMapCatalog()) { String catalog = targetDataMap.getDefaultCatalog(); for (DbEntity e : sourceDataMap.getDbEntities()) { e.setCatalog(catalog); } } if (configuration.isForceDataMapSchema()) { String schema = targetDataMap.getDefaultSchema(); for (DbEntity e : sourceDataMap.getDbEntities()) { e.setSchema(schema); } } }
protected void updateCatalog() { boolean doAll = isAllEntities(); String defaultCatalog = dataMap.getDefaultCatalog(); // set catalog for DbEntities for (DbEntity entity : dataMap.getDbEntities()) { if (doAll || Util.isEmptyString(entity.getCatalog())) { if (!Util.nullSafeEquals(defaultCatalog, entity.getCatalog())) { entity.setCatalog(defaultCatalog); // any way to batch events, a big change will flood the app // with entity events..? mediator.fireDbEntityEvent(new EntityEvent(this, entity)); } } } // set catalog for procedures... for (Procedure procedure : dataMap.getProcedures()) { if (doAll || Util.isEmptyString(procedure.getCatalog())) { if (!Util.nullSafeEquals(defaultCatalog, procedure.getCatalog())) { procedure.setCatalog(defaultCatalog); // any way to batch events, a big change will flood the app // with procedure events..? mediator.fireProcedureEvent(new ProcedureEvent(this, procedure)); } } } view.dispose(); }