Merge pull request #13482 from AndriiLandiak/fix-find-tenant-by-name

Fix findTenantByName as tenant tile is not unique
This commit is contained in:
Viacheslav Klimov 2025-05-30 13:21:59 +03:00 committed by GitHub
commit 460a793aa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ public class JpaTenantDao extends JpaAbstractDao<TenantEntity, Tenant> implement
@Override @Override
public Tenant findTenantByName(TenantId tenantId, String name) { public Tenant findTenantByName(TenantId tenantId, String name) {
return DaoUtil.getData(tenantRepository.findTenantByTitle(name)); return DaoUtil.getData(tenantRepository.findFirstByTitle(name));
} }
@Override @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") "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); List<TenantFields> findNextBatch(@Param("id") UUID id, Limit limit);
TenantEntity findTenantByTitle(String name); TenantEntity findFirstByTitle(String name);
} }