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:
797 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.relations.StudentHomeworkRelation;
|
---|
8 | import project.educatum.model.primarykeys.StudentHomeworkRelationID;
|
---|
9 |
|
---|
10 | import javax.transaction.Transactional;
|
---|
11 | import java.util.Optional;
|
---|
12 |
|
---|
13 | @Repository
|
---|
14 | public interface StudentHomeworkRepository extends JpaRepository<StudentHomeworkRelation, StudentHomeworkRelationID> {
|
---|
15 |
|
---|
16 | @Transactional
|
---|
17 | @Modifying
|
---|
18 | @Query("UPDATE StudentHomeworkRelation h SET h.isDone=true WHERE h.id=:id")
|
---|
19 | void updateDone(Integer id);
|
---|
20 |
|
---|
21 | StudentHomeworkRelation findById(Integer id);
|
---|
22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.