Skip to content

Commit 1110d41

Browse files
committed
🚩 CRUD done successfully! Working (Tested)
Only Exception Handling Remains
1 parent 3ae59a9 commit 1110d41

File tree

16 files changed

+205
-10
lines changed

16 files changed

+205
-10
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
/Trial 1
22
/MOCK_DATA.csv
3+
/data.csv
4+
/unused
35

6+
/.metadata/

Quiz App/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
File renamed without changes.

QuizApp/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Note
2+
3+
I am using java11, hence in DAO inorder to see entities, we use public Integer id instead of private in java18
4+
!
File renamed without changes.
File renamed without changes.

Quiz App/pom.xml renamed to QuizApp/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
<version>3.1.2</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
11-
<groupId>com.kedar</groupId>
12-
<artifactId>quizapp</artifactId>
11+
<groupId>com.myapp</groupId>
12+
<artifactId>QuizApp</artifactId>
1313
<version>0.0.1-SNAPSHOT</version>
14-
<name>quizapp</name>
15-
<description>Kedar&apos;s Quiz App </description>
14+
<name>QuizApp</name>
15+
<description>Kedar&apos;s Quiz Website</description>
1616
<properties>
1717
<java.version>17</java.version>
1818
</properties>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.example.myquizapp;
2+
3+
import jakarta.persistence.Entity;
4+
import jakarta.persistence.GeneratedValue;
5+
import jakarta.persistence.GenerationType;
6+
import jakarta.persistence.Id;
7+
import lombok.Data; // this reduces gettersAnsSetters that we'll have to write for each field. eg. getQuestioNTitle and setQuestionTitle reduced by @Data
8+
// if in Database we have different entity (name) use @Entity("newName")
9+
10+
@Data
11+
@Entity
12+
public class Question {
13+
14+
// in sql - snake_casing in java - camelCasing
15+
16+
// in java ORM, _ is converted to capital letter. i.e. in database question_title is here questionTitle
17+
@Id
18+
@GeneratedValue(strategy = GenerationType.IDENTITY)
19+
public Integer id;
20+
// @GeneratedValue(strategy = GenerationType.IDENTITY) makes sure about autoIncrement, so in post object for creation, we dont need any id value
21+
22+
public String questionTitle;
23+
public String option1;
24+
public String option2;
25+
public String option3;
26+
public String option4;
27+
public String rightAnswer;
28+
public String difficultylevel;
29+
public String category;
30+
}

0 commit comments

Comments
 (0)