Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
student-personal-details-spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
student-details-microservice
student-personal-details-spring-boot
Commits
cbf770ae
Commit
cbf770ae
authored
Apr 12, 2021
by
Alex Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add validations and Lombok setters/getters to Student model
parent
1906419c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
65 deletions
+9
-65
build.gradle
build.gradle
+2
-0
Student.java
src/main/java/com/student/details/models/Student.java
+7
-65
No files found.
build.gradle
View file @
cbf770ae
...
...
@@ -35,6 +35,8 @@ dependencies {
implementation
'org.springframework.cloud:spring-cloud-starter-bootstrap:3.0.2'
implementation
"io.springfox:springfox-boot-starter:3.0.0"
compile
'org.json:json:20210307'
annotationProcessor
'org.projectlombok:lombok'
compileOnly
'org.projectlombok:lombok:1.18.16'
}
dependencyManagement
{
...
...
src/main/java/com/student/details/models/Student.java
View file @
cbf770ae
package
com
.
student
.
details
.
models
;
import
lombok.Data
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotNull
;
import
java.time.LocalDate
;
@Entity
@Table
(
name
=
"student_details"
)
@Data
public
class
Student
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
...
...
@@ -14,69 +16,9 @@ public class Student {
@Column
(
unique
=
true
)
private
String
email
;
private
String
firstName
;
private
String
lastName
;
private
LocalDate
dateOfBirth
;
private
String
course
;
public
Student
(
Long
id
,
String
email
,
String
firstName
,
String
lastName
,
LocalDate
dateOfBirth
,
String
course
)
{
this
.
id
=
id
;
this
.
email
=
email
;
this
.
firstName
=
firstName
;
this
.
lastName
=
lastName
;
this
.
dateOfBirth
=
dateOfBirth
;
this
.
course
=
course
;
}
public
Student
()
{
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
@NotNull
private
String
firstName
,
lastName
,
course
;
public
String
getFirstName
()
{
return
firstName
;
}
public
void
setFirstName
(
String
firstName
)
{
this
.
firstName
=
firstName
;
}
public
String
getLastName
()
{
return
lastName
;
}
public
void
setLastName
(
String
lastName
)
{
this
.
lastName
=
lastName
;
}
public
LocalDate
getDateOfBirth
()
{
return
dateOfBirth
;
}
public
void
setDateOfBirth
(
LocalDate
dateOfBirth
)
{
this
.
dateOfBirth
=
dateOfBirth
;
}
public
String
getCourse
()
{
return
course
;
}
public
void
setCourse
(
String
course
)
{
this
.
course
=
course
;
}
@NotNull
private
LocalDate
dateOfBirth
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment