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:
813 bytes
|
Line | |
---|
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.Class;
|
---|
8 | import project.educatum.model.Payment;
|
---|
9 |
|
---|
10 | import javax.transaction.Transactional;
|
---|
11 | import java.util.List;
|
---|
12 |
|
---|
13 | @Repository
|
---|
14 | public interface PaymentRepository extends JpaRepository<Payment, Integer> {
|
---|
15 |
|
---|
16 | @Query(value = "select * from project.plakjanja p where p.id_nastavnik = :idTeacher", nativeQuery = true)
|
---|
17 | List<Payment> findAllByIdTeacher(Integer idTeacher);
|
---|
18 |
|
---|
19 | @Transactional
|
---|
20 | @Modifying
|
---|
21 | @Query("UPDATE Payment p SET p.amount=:price WHERE p.id=:id")
|
---|
22 | void updatePrice(Integer price, Integer id);
|
---|
23 |
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.