@Test(expected = NullPointerException.class) public void deleteConfiguration_shouldThrowOnNullPluginId() { NamedConfiguration config = new NamedConfiguration(1, 1, null, "Configuration 2", null, false); namedConfigurationDAO.deleteConfiguration(config); }
public int deleteConfiguration(NamedConfiguration namedConfiguration) { Preconditions.checkNotNull(namedConfiguration); Preconditions.checkNotNull(namedConfiguration.getName()); Preconditions.checkNotNull(namedConfiguration.getPluginId()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getUri()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getVersion()); return deleteConfiguration.update(namedConfiguration.getTenantId(), namedConfiguration.getAssocTypeId(), namedConfiguration.getPluginId().getUri().toASCIIString(), namedConfiguration.getPluginId().getVersion().toString(), namedConfiguration.getName()); }
NamedConfigurationDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements NamedConfigurationDAO { public int deleteConfiguration(NamedConfiguration namedConfiguration) { Preconditions.checkNotNull(namedConfiguration); Preconditions.checkNotNull(namedConfiguration.getName()); Preconditions.checkNotNull(namedConfiguration.getPluginId()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getUri()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getVersion()); return deleteConfiguration.update(namedConfiguration.getTenantId(), namedConfiguration.getAssocTypeId(), namedConfiguration.getPluginId().getUri().toASCIIString(), namedConfiguration.getPluginId().getVersion().toString(), namedConfiguration.getName()); } }
NamedConfigurationDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements NamedConfigurationDAO { public int deleteConfiguration(NamedConfiguration namedConfiguration) { Preconditions.checkNotNull(namedConfiguration); Preconditions.checkNotNull(namedConfiguration.getName()); Preconditions.checkNotNull(namedConfiguration.getPluginId()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getUri()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getVersion()); return deleteConfiguration.update(namedConfiguration.getTenantId(), namedConfiguration.getAssocTypeId(), namedConfiguration.getPluginId().getUri().toASCIIString(), namedConfiguration.getPluginId().getVersion().toString(), namedConfiguration.getName()); } NamedConfigurationDAOMysqlImpl(DataSource dataSource, SqlScriptService sqlScriptService,
                                          PluginRegistry pluginRegistry); }
NamedConfigurationDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements NamedConfigurationDAO { public int deleteConfiguration(NamedConfiguration namedConfiguration) { Preconditions.checkNotNull(namedConfiguration); Preconditions.checkNotNull(namedConfiguration.getName()); Preconditions.checkNotNull(namedConfiguration.getPluginId()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getUri()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getVersion()); return deleteConfiguration.update(namedConfiguration.getTenantId(), namedConfiguration.getAssocTypeId(), namedConfiguration.getPluginId().getUri().toASCIIString(), namedConfiguration.getPluginId().getVersion().toString(), namedConfiguration.getName()); } NamedConfigurationDAOMysqlImpl(DataSource dataSource, SqlScriptService sqlScriptService,
                                          PluginRegistry pluginRegistry); @Override String getDefaultTableName(); @Override String getTableCreatingSQLScriptName(); int updateConfiguration(NamedConfiguration namedConfiguration); int createConfiguration(NamedConfiguration namedConfiguration); int deleteConfiguration(NamedConfiguration namedConfiguration); NamedConfiguration readConfiguration(int tenantId, int assocTypeId, PluginId pluginId, String name); List<NamedConfiguration> readConfigurations(int tenantId, int assocTypeId, PluginId pluginId); NamedConfiguration readActiveConfiguration(int tenantId, int assocTypeId); int deactivateByPlugin(PluginId pluginId); int deactivateByAssocType(Integer tenantId, Integer assocTypeId); }
NamedConfigurationDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements NamedConfigurationDAO { public int deleteConfiguration(NamedConfiguration namedConfiguration) { Preconditions.checkNotNull(namedConfiguration); Preconditions.checkNotNull(namedConfiguration.getName()); Preconditions.checkNotNull(namedConfiguration.getPluginId()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getUri()); Preconditions.checkNotNull(namedConfiguration.getPluginId().getVersion()); return deleteConfiguration.update(namedConfiguration.getTenantId(), namedConfiguration.getAssocTypeId(), namedConfiguration.getPluginId().getUri().toASCIIString(), namedConfiguration.getPluginId().getVersion().toString(), namedConfiguration.getName()); } NamedConfigurationDAOMysqlImpl(DataSource dataSource, SqlScriptService sqlScriptService,
                                          PluginRegistry pluginRegistry); @Override String getDefaultTableName(); @Override String getTableCreatingSQLScriptName(); int updateConfiguration(NamedConfiguration namedConfiguration); int createConfiguration(NamedConfiguration namedConfiguration); int deleteConfiguration(NamedConfiguration namedConfiguration); NamedConfiguration readConfiguration(int tenantId, int assocTypeId, PluginId pluginId, String name); List<NamedConfiguration> readConfigurations(int tenantId, int assocTypeId, PluginId pluginId); NamedConfiguration readActiveConfiguration(int tenantId, int assocTypeId); int deactivateByPlugin(PluginId pluginId); int deactivateByAssocType(Integer tenantId, Integer assocTypeId);  }