source: src/main/java/edu/gjoko/schedlr/repositories/ServiceRepository.java

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 
1package edu.gjoko.schedlr.repositories;
2
3import edu.gjoko.schedlr.entity.Service;
4import org.springframework.data.jpa.repository.JpaRepository;
5import org.springframework.data.jpa.repository.Modifying;
6import org.springframework.data.jpa.repository.Query;
7import org.springframework.stereotype.Repository;
8
9import java.util.List;
10
11@Repository
12public 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.