public boolean removeLibraryDilution(LibraryDilution d) throws IOException {
NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
if (d.isDeletable() &&
(namedTemplate.update(LIBRARY_DILUTION_DELETE,
new MapSqlParameterSource().addValue("dilutionId", d.getId())) == 1)) {
Library l = d.getLibrary();
if(this.cascadeType.equals(CascadeType.PERSIST)) {
if (l != null) libraryDAO.save(l);
}
else if (this.cascadeType.equals(CascadeType.REMOVE)) {
if (l != null) {
Cache pc = cacheManager.getCache("libraryCache");
pc.remove(DbUtils.hashCodeCacheKeyFor(l.getId()));
}
}
return true;
}
return false;