source: src/main/java/project/educatum/repository/TeacherRepository.java

Last change on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 699 bytes
Line 
1package project.educatum.repository;
2
3import org.springframework.data.jpa.repository.JpaRepository;
4import org.springframework.data.jpa.repository.Modifying;
5import org.springframework.data.jpa.repository.Query;
6import org.springframework.stereotype.Repository;
7import project.educatum.model.Teacher;
8
9import javax.transaction.Transactional;
10import java.util.List;
11
12@Repository
13public interface TeacherRepository extends JpaRepository<Teacher, Integer> {
14 Teacher findByEmail(String email);
15
16 List<Teacher> findAllByNameContainingIgnoreCase(String name);
17
18 @Transactional
19 @Modifying
20 @Query("UPDATE Teacher n SET n.enabled=true WHERE n.id=:id")
21 void updateEnabled(Integer id);
22}
Note: See TracBrowser for help on using the repository browser.