Hi,
I have a finder which shoud return only one object but instead tries to return a collection of two objects.
Here is how the finder looks like:
Here is what the console log shows:
select contactref0_.id as id34_, contactref0_.version as version34_, contactref0_.description as descript3_34_, contactref0_.list_order as list4_34_ from contact_referer contactref0_ order by contactref0_.list_order ASC limit 2
My test is simple:
Any clue ?
Kind Regards,
Stephane
I have a finder which shoud return only one object but instead tries to return a collection of two objects.
Here is how the finder looks like:
Code:
@Query("SELECT cr FROM ContactReferer cr ORDER BY cr.listOrder ASC LIMIT 1")
public ContactReferer findFirst();
Quote:
select contactref0_.id as id34_, contactref0_.version as version34_, contactref0_.description as descript3_34_, contactref0_.list_order as list4_34_ from contact_referer contactref0_ order by contactref0_.list_order ASC limit 2
Code:
ContactReferer loadedContactReferer = contactRefererRepository.findFirst();
assertEquals(contactReferer1.getDescription(), loadedContactReferer.getDescription());
Kind Regards,
Stephane