Added docs into repositories

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-11-20 14:50:07 +01:00
parent af8e2ced28
commit 50c1397db2
Signed by: y0rune
GPG Key ID: F204C385F57EB348
5 changed files with 47 additions and 0 deletions

View File

@ -9,6 +9,13 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/**
* AssignmentRepository.getByCommision:
* Return list of:
* SELECT * FROM Assignment WHERE commision_id = i .
*
* Where i, ?1 are equale to variables.
*/
@Repository @Repository
public interface AssignmentRepository extends JpaRepository<Assignment, Long> { public interface AssignmentRepository extends JpaRepository<Assignment, Long> {

View File

@ -9,6 +9,19 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/**
* CommisionRepository.getUsers:
* Return list of:
* SELECT * FROM Commision WHERE owner_id = i .
*
* Where i, ?1 are equale to variables.
*
* CommisionRepository.getNewestCommision
* Return list of:
* SELECT * FROM Commision WHERE owner_id = i Order by commisionDate desc.
*
* Where i, ?1 are equale to variables.
*/
@Repository @Repository
public interface CommisionRepository extends JpaRepository<Commision, Long> { public interface CommisionRepository extends JpaRepository<Commision, Long> {
@Query("FROM Commision WHERE owner_id = ?1") @Query("FROM Commision WHERE owner_id = ?1")

View File

@ -9,6 +9,13 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/**
* CourseRepository.findByName:
* Return list of:
* SELECT * FROM Course WHERE name = i .
*
* Where i, ?1 are equale to variables.
*/
@Repository @Repository
public interface CourseRepository extends JpaRepository<Course, Long> { public interface CourseRepository extends JpaRepository<Course, Long> {
@Query("FROM Course WHERE name = ?1") @Query("FROM Course WHERE name = ?1")

View File

@ -10,6 +10,19 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/**
* GroupRepository.find:
* Return list of:
* SELECT * FROM Groups WHERE time = i AND room = j AND capacity = k .
*
* Where i, j, k, ?1, ?2, ?3 are equale to variables.
*
* GroupRepository.getByCourse:
* Return list of:
* SELECT * FROM Groups WHERE course_id = i .
*
* Where i, ?1 are equale to variables.
*/
@Repository @Repository
public interface GroupRepository extends JpaRepository<Groups, Long> { public interface GroupRepository extends JpaRepository<Groups, Long> {
@Query("FROM Groups WHERE time = ?1 AND room = ?2 AND capacity = ?3") @Query("FROM Groups WHERE time = ?1 AND room = ?2 AND capacity = ?3")

View File

@ -9,6 +9,13 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/**
* LecturerRepository.find:
* Return list of:
* SELECT * FROM Lecturer WHERE title = i AND name = j AND surname = k.
*
* Where i, j, k, ?1, ?2, ?3 are equale to variables.
*/
@Repository @Repository
public interface LecturerRepository extends JpaRepository<Lecturer, Long> { public interface LecturerRepository extends JpaRepository<Lecturer, Long> {
@Query("FROM Lecturer WHERE title = ?1 AND name = ?2 AND surname = ?3") @Query("FROM Lecturer WHERE title = ?1 AND name = ?2 AND surname = ?3")