Remove redundant existsById from dao.removeById

This commit is contained in:
ViacheslavKlimov 2024-07-05 14:32:42 +03:00
parent 50b2d0e488
commit 1a2040d4cd
2 changed files with 2 additions and 5 deletions

View File

@ -39,7 +39,7 @@ public interface Dao<T> {
T saveAndFlush(TenantId tenantId, T t); T saveAndFlush(TenantId tenantId, T t);
boolean removeById(TenantId tenantId, UUID id); void removeById(TenantId tenantId, UUID id);
void removeAllByIds(Collection<UUID> ids); void removeAllByIds(Collection<UUID> ids);

View File

@ -144,12 +144,9 @@ public abstract class JpaAbstractDao<E extends BaseEntity<D>, D>
@Override @Override
@Transactional @Transactional
public boolean removeById(TenantId tenantId, UUID id) { public void removeById(TenantId tenantId, UUID id) {
// jdbcTemplate.queryForObject("DELETE FROM " + getEntityType().getTableName() + " WHERE id = ? RETURNING version", Integer.class, id);
// TODO: increment version...
getRepository().deleteById(id); getRepository().deleteById(id);
log.debug("Remove request: {}", id); log.debug("Remove request: {}", id);
return !getRepository().existsById(id);
} }
@Transactional @Transactional