コード例 #1
0
  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;
    }
  }
コード例 #2
0
 public static void setDropTypeToGenerate(DropType type, String objectType) {
   Settings.getInstance()
       .setProperty(
           "workbench.dbexplorer.generate.drop." + DbSettings.getKeyValue(objectType),
           type.name());
 }
コード例 #3
0
 public static void setDropTypeToGenerate(DropType type) {
   Settings.getInstance().setProperty("workbench.dbexplorer.generate.drop", type.name());
 }