コード例 #1
0
  @Override
  public void assertNotChanged(final I_M_HU_LUTU_Configuration lutuConfiguration) {
    Check.assumeNotNull(lutuConfiguration, "lutuConfiguration not null");

    //
    // Check if we were explicitly asked to not check the changes
    final Boolean disableChangeCheckingOnSave =
        InterfaceWrapperHelper.getDynAttribute(
            lutuConfiguration, DYNATTR_DisableChangeCheckingOnSave);
    if (disableChangeCheckingOnSave != null && disableChangeCheckingOnSave == true) {
      return;
    }

    //
    // Make sure LU/TU configuration does not changed (from LUTU Producer perspective)
    final I_M_HU_LUTU_Configuration lutuConfigurationOld =
        InterfaceWrapperHelper.createOld(lutuConfiguration, I_M_HU_LUTU_Configuration.class);
    if (isSameForHUProducer(lutuConfiguration, lutuConfigurationOld)) {
      return;
    }

    //
    // Prevent changing the configuration
    // NOTE: it's safe to throw an english/internal error because mainly this is an internal error
    throw new HUException(
        "Changing already saved LU/TU Configuration is not allowed: " + lutuConfiguration);
  }
コード例 #2
0
ファイル: ADTableDAO.java プロジェクト: teosarca/metasfresh
  @Override
  public void onTableNameRename(final I_AD_Table table) {
    Check.assumeNotNull(table, "table not null");
    final I_AD_Table tableOld = InterfaceWrapperHelper.createOld(table, I_AD_Table.class);
    final String tableNameOld = tableOld.getTableName();
    final String tableNameNew = table.getTableName();

    // Do nothing if the table name was not actually changed
    if (Check.equals(tableNameOld, tableNameNew)) {
      return;
    }

    final Properties ctx = InterfaceWrapperHelper.getCtx(table);
    Services.get(ISequenceDAO.class).renameTableSequence(ctx, tableNameOld, tableNameNew);
  }