ctudose / java-persistence-spring-data-hibernate

58 stars 51 forks source link

CH08-mapping-collections/bagofstrings: The ItemRepository.findImagesNative() does not return duplicates #4

Open lidinh65 opened 1 year ago

lidinh65 commented 1 year ago

bagofstrings

public interface ItemRepository extends JpaRepository<Item, Long> {
...
    Set<String> findImagesNative(Long id);     
}

Need to update return type "Collection<String>" as in Item

public class MappingCollectionsSpringDataJPATest {
...
        Set<String> images = itemRepository.findImagesNative(item.getId());
...
}

Need to update type "Collection<String>" as well

Thanks!

lidinh65 commented 1 year ago

Found the same issue with bagofstringsorderby