fixed tests
This commit is contained in:
parent
874d59a706
commit
97b45a6bf9
@ -206,6 +206,11 @@ public class DefaultJobService extends AbstractEntityService implements JobServi
|
||||
jobDao.removeById(tenantId, id.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTenantId(TenantId tenantId) {
|
||||
jobDao.deleteByTenantId(tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getEntityType() {
|
||||
return EntityType.JOB;
|
||||
|
||||
@ -38,4 +38,6 @@ public interface JobDao extends Dao<Job> {
|
||||
|
||||
Job findOldestByTenantIdAndTypeAndStatusForUpdate(TenantId tenantId, JobType type, JobStatus status);
|
||||
|
||||
void deleteByTenantId(TenantId tenantId);
|
||||
|
||||
}
|
||||
|
||||
@ -45,7 +45,9 @@ public interface JobRepository extends JpaRepository<JobEntity, UUID> {
|
||||
@Query("SELECT j FROM JobEntity j WHERE j.id = :id")
|
||||
JobEntity findByIdForUpdate(UUID id);
|
||||
|
||||
JobEntity findLatestByTenantIdAndKey(UUID tenantId, String key);
|
||||
@Query("SELECT j FROM JobEntity j WHERE j.tenantId = :tenantId AND j.key = :key " +
|
||||
"ORDER BY j.createdTime DESC")
|
||||
JobEntity findLatestByTenantIdAndKey(@Param("tenantId") UUID tenantId, @Param("key") String key);
|
||||
|
||||
boolean existsByTenantIdAndKeyAndStatusIn(UUID tenantId, String key, List<JobStatus> statuses);
|
||||
|
||||
@ -56,4 +58,6 @@ public interface JobRepository extends JpaRepository<JobEntity, UUID> {
|
||||
"AND j.status = :status ORDER BY j.createdTime ASC, j.id ASC")
|
||||
JobEntity findOldestByTenantIdAndTypeAndStatusForUpdate(UUID tenantId, JobType type, JobStatus status, Limit limit);
|
||||
|
||||
void deleteByTenantId(UUID tenantId);
|
||||
|
||||
}
|
||||
|
||||
@ -74,6 +74,11 @@ public class JpaJobDao extends JpaAbstractDao<JobEntity, Job> implements JobDao
|
||||
return DaoUtil.getData(jobRepository.findOldestByTenantIdAndTypeAndStatusForUpdate(tenantId.getId(), type, status, Limit.of(1)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByTenantId(TenantId tenantId) {
|
||||
jobRepository.deleteByTenantId(tenantId.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getEntityType() {
|
||||
return EntityType.JOB;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user