Last change
on this file since f29cd58 was f29cd58, checked in by gjoko kostadinov <gjokokostadinov@…>, 6 months ago |
Add services search functionality.
|
-
Property mode
set to
100755
|
File size:
717 bytes
|
Rev | Line | |
---|
[950fa0d] | 1 | package edu.gjoko.schedlr.repositories;
|
---|
| 2 |
|
---|
| 3 | import edu.gjoko.schedlr.entity.Service;
|
---|
| 4 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
[1413ee2] | 5 | import org.springframework.data.jpa.repository.Modifying;
|
---|
| 6 | import org.springframework.data.jpa.repository.Query;
|
---|
[950fa0d] | 7 | import org.springframework.stereotype.Repository;
|
---|
| 8 |
|
---|
[1413ee2] | 9 | import java.util.List;
|
---|
| 10 |
|
---|
[950fa0d] | 11 | @Repository
|
---|
| 12 | public interface ServiceRepository extends JpaRepository<Service, Long> {
|
---|
[f29cd58] | 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);
|
---|
[950fa0d] | 19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.