Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TAM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
TAM
Merge requests
!39
Move Validate methods
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Move Validate methods
backend_validate_service
into
master
Overview
0
Commits
3
Pipelines
1
Changes
19
Merged
Move Validate methods
Otto Visser
requested to merge
backend_validate_service
into
master
May 29, 2018
Overview
0
Commits
3
Pipelines
1
Changes
19
In this merge request, the following is changed:
The methods validateCourse, validateCourseCode and validateActive are moved from the CourseEditionRepository to the CourseEditionService.
The method validateNoteExists is moved from the NoteRepository to the NoteService.
The method validateActive is moved from the ScheduleRepository to the ScheduleService.
Edited
May 29, 2018
by
Otto Visser
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
444af526
3 commits,
May 30, 2018
19 files
+
364
−
305
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
19
src/main/java/nl/tudelft/ewi/tam/repositories/CourseEditionRepository.java
+
0
−
39
View file @ 444af526
Edit in single-file editor
Open in Web IDE
Show full file
@@ -2,9 +2,6 @@ package nl.tudelft.ewi.tam.repositories;
import
nl.tudelft.ewi.tam.JdbcDaoImpl
;
import
nl.tudelft.ewi.tam.beans.CourseEdition
;
import
nl.tudelft.ewi.tam.exceptions.CourseAlreadyExistsException
;
import
nl.tudelft.ewi.tam.exceptions.CourseNotActiveException
;
import
nl.tudelft.ewi.tam.exceptions.CourseNotFoundException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.stereotype.Repository
;
@@ -216,40 +213,4 @@ public class CourseEditionRepository {
final
int
[]
argumentTypes
=
{
Types
.
INTEGER
};
return
jdbcDaoImpl
.
count
(
CHECK_ACTIVE
,
arguments
,
argumentTypes
)
>
0
;
}
/**
* Validate whether a course exists with the given id.
*
* @param courseId the id of the course to look for
* @throws CourseNotFoundException thrown when the course is not found
*/
public
void
validateCourse
(
final
int
courseId
)
throws
CourseNotFoundException
{
if
(!
isCourse
(
courseId
))
{
throw
new
CourseNotFoundException
(
courseId
);
}
}
/**
* Validate whether the course code is unique.
*
* @param courseCode the course code to verify
* @throws CourseAlreadyExistsException thrown when there already is a course with the given course code
*/
public
void
validateCourseCode
(
final
String
courseCode
)
throws
CourseAlreadyExistsException
{
if
(
isCourse
(
courseCode
))
{
throw
new
CourseAlreadyExistsException
(
courseCode
);
}
}
/**
* Validate whether the course with the given id is active.
*
* @param courseId the id of the course to check
* @throws CourseNotActiveException thrown when the course is not active
*/
public
void
validateActive
(
final
int
courseId
)
throws
CourseNotActiveException
{
if
(!
isActive
(
courseId
))
{
throw
new
CourseNotActiveException
(
courseId
);
}
}
}
Loading