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
|
Rev | Line | |
---|
[d3cf3a1] | 1 | package project.educatum.repository;
|
---|
| 2 |
|
---|
| 3 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
| 4 | import org.springframework.data.jpa.repository.Modifying;
|
---|
| 5 | import org.springframework.data.jpa.repository.Query;
|
---|
| 6 | import org.springframework.stereotype.Repository;
|
---|
| 7 | import project.educatum.model.Teacher;
|
---|
| 8 |
|
---|
| 9 | import javax.transaction.Transactional;
|
---|
| 10 | import java.util.List;
|
---|
| 11 |
|
---|
| 12 | @Repository
|
---|
| 13 | public 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.