-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
entity-edit #1
entity-edit #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,14 @@ | |
|
||
@Entity | ||
@Data | ||
@Table(name = "discussions") | ||
public class Discussion { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "title", nullable = false) | ||
private String title; | ||
private String body; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please use the word description instead of body here as well? |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,32 @@ | |
|
||
@Entity | ||
@Data | ||
@Table(name = "events") | ||
public class Event { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "name", nullable = false) | ||
private String name; | ||
|
||
@Column(name = "body", nullable = false) | ||
private String body; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please use the word |
||
|
||
@Column(nullable = false) | ||
private LocalDate eventDate; | ||
|
||
@Column(nullable = false) | ||
private LocalTime eventTime; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more thing, is there a purpose of having these two fields separate? private LocalDate eventDate; I mean, can we combine them into one field? |
||
private String files; | ||
|
||
// @ManyToOne | ||
// private Admin createdByAdmin; | ||
|
||
@ManyToOne | ||
private DiscussionCategory category; | ||
// | ||
// @ManyToOne | ||
// private DiscussionCategory category; | ||
|
||
@ManyToMany | ||
private List<Student> attendedStudents; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,17 @@ | |
|
||
@Entity | ||
@Data | ||
@Table(name = "feedbacks") | ||
public class Feedback { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "title", nullable = false) | ||
private String title; | ||
|
||
@Column(name = "body") | ||
private String body; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please use the word description instead of body here as well? |
||
|
||
@ManyToOne | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.waa.project.enums; | ||
|
||
public enum AccountStatusType { | ||
|
||
Active, | ||
Banned, | ||
Inactive | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.waa.project.enums; | ||
|
||
public enum GenderType { | ||
|
||
Male, | ||
Female | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
spring.application.name=project | ||
|
||
spring.datasource.url=jdbc:mysql://localhost:3306/waa-demo | ||
spring.datasource.username=root | ||
spring.datasource.password= | ||
|
||
spring.datasource.password=root | ||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver | ||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect | ||
|
||
spring.jpa.hibernate.ddl-auto=create-drop | ||
spring.jpa.show-sql=true | ||
|
||
spring.jpa.defer-datasource-initialization=true | ||
spring.sql.init.mode=always |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
spring: | ||
application: | ||
name: project | ||
|
||
datasource: | ||
url: jdbc:mysql://localhost:3306/waa-demo | ||
username: root | ||
password: root | ||
driver-class-name: com.mysql.jdbc.Driver | ||
|
||
jpa: | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.MySQLDialect | ||
hibernate: | ||
ddl-auto: create-drop | ||
show-sql: true | ||
defer-datasource-initialization: true | ||
|
||
sql: | ||
init: | ||
mode: always |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
insert into majors (id,name,description) value (1, 'Compro', 'IT and Computer Science'); | ||
insert into majors (id,name,description) value (2, 'MBA', 'Business Management'); | ||
|
||
INSERT into feedback_categories(name, description) VALUES ("University Feedback", "Feedback on University in general"); | ||
INSERT into feedback_categories(name, description) VALUES ("Faculity Feedback", "Feedback to Faculity in general"); | ||
|
||
INSERT into discussion_categories(name, description) VALUES("Life in USA", "Personal experiences sharing being in USA"); | ||
INSERT into discussion_categories(name, description) VALUES("Persoanl Health", "Importantce of personal health"); | ||
|
||
-- temp | ||
insert into users(id,username,password,first_name,last_name,email,birth_date,gender_type,account_status,role_type) | ||
values (1,"student1","123","Student","1","student1@gmail.com",null,"Male","Active","STUDENT"); | ||
|
||
-- temp | ||
insert into students(id,student_code,major_id,academic_years,picture) values (1,"159880", 1 , "2024", "1234"); | ||
|
||
--temp | ||
insert into achievements(student_id,achievements) values (1, "Successfully completed 4 Subject Master Course on Campus"); | ||
|
||
--temp | ||
insert into interests(student_id,interest) values (1, "Coding"); | ||
insert into interests(student_id,interest) values (1, "Swimming"); | ||
insert into interests(student_id,interest) values (1, "Learning New Technology"); | ||
|
||
--temp | ||
insert into extra_activities(student_id,extra_activities) values (1, "Social Party"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please use the word
description
instead ofbody
?