Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
school-portal
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
Muhammad Suleman
school-portal
Commits
09f42185
Commit
09f42185
authored
Jul 16, 2022
by
Muhammad Suleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Section Service
parent
6c2d7aee
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
+13
-11
Course.java
src/main/java/com/school/project/model/Course.java
+1
-0
Assessment.java
src/main/java/com/school/project/model/marks/Assessment.java
+2
-4
Section.java
src/main/java/com/school/project/model/marks/Section.java
+6
-4
StudentMarks.java
...ain/java/com/school/project/model/marks/StudentMarks.java
+1
-1
application.properties
src/main/resources/application.properties
+3
-2
No files found.
src/main/java/com/school/project/model/Course.java
View file @
09f42185
...
...
@@ -41,5 +41,6 @@ public class Course {
private
Set
<
Teacher
>
teacherList
;
@OneToMany
(
mappedBy
=
"course"
,
cascade
=
CascadeType
.
ALL
,
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
private
List
<
Assessment
>
assessment
;
}
src/main/java/com/school/project/model/marks/Assessment.java
View file @
09f42185
...
...
@@ -36,10 +36,8 @@ public class Assessment {
@JsonIgnore
private
Course
course
;
@OneToMany
(
cascade
=
CascadeType
.
MERGE
,
fetch
=
FetchType
.
LAZY
,
orphanRemoval
=
true
)
@JoinTable
(
name
=
"assessment_sections"
,
joinColumns
=
{
@JoinColumn
(
name
=
"assessment_id"
)},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"section_id"
)})
@OneToMany
(
mappedBy
=
"assessment"
,
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
private
List
<
Section
>
section
;
}
src/main/java/com/school/project/model/marks/Section.java
View file @
09f42185
...
...
@@ -6,6 +6,7 @@ import lombok.Getter;
import
lombok.Setter
;
import
javax.persistence.*
;
import
java.util.Set
;
@Getter
@Setter
...
...
@@ -28,13 +29,14 @@ public class Section {
@ManyToOne
(
fetch
=
FetchType
.
LAZY
)
@JoinTable
(
name
=
"assessment_sections"
,
joinColumns
=
{
@JoinColumn
(
name
=
"assessment_id"
,
insertable
=
false
,
updatable
=
false
)},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"section_id"
,
insertable
=
false
,
updatable
=
false
)})
joinColumns
=
{
@JoinColumn
(
name
=
"section_id"
)},
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"assessment_id"
)})
@JsonIgnore
private
Assessment
assessment
;
@OneTo
One
(
mappedBy
=
"section"
,
cascade
=
CascadeType
.
ALL
,
fetch
=
FetchType
.
LAZY
)
@OneTo
Many
(
mappedBy
=
"section"
,
cascade
=
CascadeType
.
ALL
,
fetch
=
FetchType
.
LAZY
)
@JsonIgnore
private
S
tudentMarks
studentMarks
;
private
S
et
<
StudentMarks
>
studentMarks
;
}
src/main/java/com/school/project/model/marks/StudentMarks.java
View file @
09f42185
...
...
@@ -26,7 +26,7 @@ public class StudentMarks {
@NotNull
private
Student
student
;
@
One
ToOne
(
fetch
=
FetchType
.
LAZY
,
cascade
=
CascadeType
.
ALL
)
@
Many
ToOne
(
fetch
=
FetchType
.
LAZY
,
cascade
=
CascadeType
.
ALL
)
@JoinColumn
(
name
=
"section_id"
)
@NotNull
private
Section
section
;
...
...
src/main/resources/application.properties
View file @
09f42185
...
...
@@ -2,7 +2,8 @@
spring.jpa.hibernate.ddl-auto
=
update
spring.datasource.url
=
jdbc:mysql://localhost:3306/school-portal
spring.datasource.username
=
root
spring.datasource.password
=
charlie123
spring.datasource.password
=
root
spring.security.user.name
=
sulemantalpur6@gmail.com
spring.security.user.password
=
charlie
...
...
@@ -12,4 +13,4 @@ spring.mvc.view.prefix=/static
server.error.include-message
=
always
spring.datasource.data
=
data.sql
\ No newline at end of file
spring.datasource.data
=
classpath:data.sql
\ No newline at end of file
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