public static DropType getDropTypeToGenerate(String objectType) { String baseKey = "workbench.dbexplorer.generate.drop"; String type = Settings.getInstance().getProperty(baseKey, DropType.cascaded.name()); if (objectType != null && !"default".equalsIgnoreCase(objectType)) { type = Settings.getInstance() .getProperty(baseKey + "." + DbSettings.getKeyValue(objectType), type); } // migrate from the old setting (true/false) if ("true".equalsIgnoreCase(type)) { return DropType.cascaded; } if ("false".equalsIgnoreCase(type)) { return DropType.none; } try { return DropType.valueOf(type); } catch (Exception ex) { return DropType.cascaded; } }
public static void setDropTypeToGenerate(DropType type, String objectType) { Settings.getInstance() .setProperty( "workbench.dbexplorer.generate.drop." + DbSettings.getKeyValue(objectType), type.name()); }
public static void setDropTypeToGenerate(DropType type) { Settings.getInstance().setProperty("workbench.dbexplorer.generate.drop", type.name()); }