1
|
package cz.zcu.kiv.backendapi.catalog;
|
2
|
|
3
|
import org.springframework.data.jpa.repository.JpaRepository;
|
4
|
import org.springframework.data.jpa.repository.Query;
|
5
|
import org.springframework.stereotype.Repository;
|
6
|
|
7
|
import java.util.List;
|
8
|
import java.util.UUID;
|
9
|
|
10
|
/**
|
11
|
* Catalog repository
|
12
|
*/
|
13
|
@Repository
|
14
|
public interface CatalogItemRepository extends JpaRepository<CatalogItem, UUID> {
|
15
|
|
16
|
/**
|
17
|
* Selects catalog items with given name (alternative name)
|
18
|
*
|
19
|
* @param name name
|
20
|
* @return list of catalog items with given name
|
21
|
*/
|
22
|
@Query("SELECT DISTINCT a.catalogItem FROM CatalogItemName a WHERE ?1 = a.name")
|
23
|
List<CatalogItem> getItemsByName(String name);
|
24
|
}
|