Search in sources :

Example 1 with PhysicalLogicRelation

use of com.cubrid.common.ui.er.logic.PhysicalLogicRelation in project cubrid-manager by CUBRID.

the class SetPhysicalLogicaMapDialog method checkNewMapValid.

private void checkNewMapValid() throws ERException {
    ERSchema copySchema = erSchema.clone();
    PhysicalLogicRelation relation = copySchema.getPhysicalLogicRelation();
    relation.setDataTypeMap(newColumnTypeMap);
    //refresh all columns physical/logical data type by map
    copySchema.setPhysicalLogicRelation(relation);
    List<ERTable> tables = copySchema.getTables();
    for (ERTable table : tables) {
        table.checkValidate();
    }
}
Also used : ERSchema(com.cubrid.common.ui.er.model.ERSchema) PhysicalLogicRelation(com.cubrid.common.ui.er.logic.PhysicalLogicRelation) ERTable(com.cubrid.common.ui.er.model.ERTable)

Example 2 with PhysicalLogicRelation

use of com.cubrid.common.ui.er.logic.PhysicalLogicRelation in project cubrid-manager by CUBRID.

the class SetPhysicalLogicaMapDialog method okPressed.

protected void okPressed() {
    if (!CommonUITool.openConfirmBox(Messages.msgConfirmChangePhysicalLogicalMap)) {
        return;
    }
    PhysicalLogicRelation.delEmptyEntry(newColumnTypeMap);
    //check all column physical data types whether are valid by the new column type map
    if (!erSchema.isPhysicModel()) {
        try {
            checkNewMapValid();
        } catch (ERException e) {
            CommonUITool.openErrorBox(getShell(), e.getMessage());
            return;
        }
    }
    PhysicalLogicRelation relation = erSchema.getPhysicalLogicRelation();
    relation.setDataTypeMap(newColumnTypeMap);
    //refresh all columns physical/logical data type by map
    erSchema.setPhysicalLogicRelation(relation);
    super.okPressed();
}
Also used : PhysicalLogicRelation(com.cubrid.common.ui.er.logic.PhysicalLogicRelation) ERException(com.cubrid.common.ui.er.ERException)

Aggregations

PhysicalLogicRelation (com.cubrid.common.ui.er.logic.PhysicalLogicRelation)2 ERException (com.cubrid.common.ui.er.ERException)1 ERSchema (com.cubrid.common.ui.er.model.ERSchema)1 ERTable (com.cubrid.common.ui.er.model.ERTable)1