Last change
on this file was f29cd58, checked in by gjoko kostadinov <gjokokostadinov@…>, 10 months ago |
Add services search functionality.
|
-
Property mode
set to
100755
|
File size:
717 bytes
|
Line | |
---|
1 | package edu.gjoko.schedlr.repositories;
|
---|
2 |
|
---|
3 | import edu.gjoko.schedlr.entity.Service;
|
---|
4 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
5 | import org.springframework.data.jpa.repository.Modifying;
|
---|
6 | import org.springframework.data.jpa.repository.Query;
|
---|
7 | import org.springframework.stereotype.Repository;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Repository
|
---|
12 | public interface ServiceRepository extends JpaRepository<Service, Long> {
|
---|
13 |
|
---|
14 | @Query(value = "select s from Service as s " +
|
---|
15 | " where (s.serviceType.name like CONCAT('%', :keyword, '%') " +
|
---|
16 | " or s.description like CONCAT('%', :keyword, '%'))" +
|
---|
17 | " and s.serviceStatus = 'ACTIVE'")
|
---|
18 | List<Service> getServicesByKeyword(String keyword);
|
---|
19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.