Fix findTenantByName as tenant tile is not unique

This commit is contained in:
Andrii Landiak 2025-05-30 12:59:48 +03:00
parent b87c8bbde6
commit 48f3b3d374
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ public class JpaTenantDao extends JpaAbstractDao<TenantEntity, Tenant> implement
@Override
public Tenant findTenantByName(TenantId tenantId, String name) {
return DaoUtil.getData(tenantRepository.findTenantByTitle(name));
return DaoUtil.getData(tenantRepository.findFirstByTitle(name));
}
@Override

View File

@ -60,6 +60,6 @@ public interface TenantRepository extends JpaRepository<TenantEntity, UUID> {
"t.additionalInfo, t.country, t.state, t.city, t.address, t.address2, t.zip, t.phone, t.email, t.region) FROM TenantEntity t WHERE t.id > :id ORDER BY t.id")
List<TenantFields> findNextBatch(@Param("id") UUID id, Limit limit);
TenantEntity findTenantByTitle(String name);
TenantEntity findFirstByTitle(String name);
}