diff --git a/pom.xml b/pom.xml
index e717a1a..b453c0b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,6 +21,15 @@
org.springframework.boot
spring-boot-starter-web
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ com.microsoft.sqlserver
+ mssql-jdbc
+
+
org.springframework.boot
spring-boot-starter-test
diff --git a/src/main/java/com/faf223/expensetrackerfaf/controller/BasicController.java b/src/main/java/com/faf223/expensetrackerfaf/controller/BasicController.java
new file mode 100644
index 0000000..fbb3f0c
--- /dev/null
+++ b/src/main/java/com/faf223/expensetrackerfaf/controller/BasicController.java
@@ -0,0 +1,26 @@
+package com.faf223.expensetrackerfaf.controller;
+
+import com.faf223.expensetrackerfaf.model.BasicEntity;
+import com.faf223.expensetrackerfaf.repository.BasicRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/getData")
+public class BasicController {
+ private final BasicRepository basicRepository;
+
+ @Autowired
+ public BasicController(BasicRepository basicRepository) {
+ this.basicRepository = basicRepository;
+ }
+
+ @GetMapping()
+ public List listDepartments() {
+ return basicRepository.findAll();
+ }
+}
diff --git a/src/main/java/com/faf223/expensetrackerfaf/controllers/GetHelloWorld.java b/src/main/java/com/faf223/expensetrackerfaf/controllers/GetHelloWorld.java
deleted file mode 100644
index 6ee56ac..0000000
--- a/src/main/java/com/faf223/expensetrackerfaf/controllers/GetHelloWorld.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.faf223.expensetrackerfaf.controllers;
-
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-class GetHelloWorld {
-
- @GetMapping("/")
- public String helloWorld() {
- return "Hello, World!";
- }
-}
diff --git a/src/main/java/com/faf223/expensetrackerfaf/custom/UppercaseStrategy.java b/src/main/java/com/faf223/expensetrackerfaf/custom/UppercaseStrategy.java
new file mode 100644
index 0000000..9c3cc83
--- /dev/null
+++ b/src/main/java/com/faf223/expensetrackerfaf/custom/UppercaseStrategy.java
@@ -0,0 +1,39 @@
+package com.faf223.expensetrackerfaf.custom;
+
+import org.hibernate.boot.model.naming.Identifier;
+import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
+import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
+
+public class UppercaseStrategy implements PhysicalNamingStrategy {
+
+ @Override
+ public Identifier toPhysicalCatalogName(Identifier identifier, JdbcEnvironment jdbcEnvironment) {
+ return identifier; // No modification for catalog name
+ }
+
+ @Override
+ public Identifier toPhysicalSchemaName(Identifier identifier, JdbcEnvironment jdbcEnvironment) {
+ return identifier; // No modification for schema name
+ }
+
+ @Override
+ public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment context) {
+ String tableName = name.getText();
+ return new Identifier(tableName, name.isQuoted());
+ }
+
+ @Override
+ public Identifier toPhysicalSequenceName(Identifier identifier, JdbcEnvironment jdbcEnvironment) {
+ return identifier; // No modification for sequence name
+ }
+
+ @Override
+ public Identifier toPhysicalColumnName(Identifier identifier, JdbcEnvironment jdbcEnvironment) {
+ return identifier; // No modification for column name
+ }
+
+ @Override
+ public Identifier toPhysicalTypeName(Identifier logicalName, JdbcEnvironment jdbcEnvironment) {
+ return PhysicalNamingStrategy.super.toPhysicalTypeName(logicalName, jdbcEnvironment);
+ }
+}
diff --git a/src/main/java/com/faf223/expensetrackerfaf/model/BasicEntity.java b/src/main/java/com/faf223/expensetrackerfaf/model/BasicEntity.java
new file mode 100644
index 0000000..06f0644
--- /dev/null
+++ b/src/main/java/com/faf223/expensetrackerfaf/model/BasicEntity.java
@@ -0,0 +1,37 @@
+package com.faf223.expensetrackerfaf.model;
+
+import jakarta.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "Department", schema = "HumanResources")
+public class BasicEntity {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "DepartmentID")
+ private Short departmentId;
+
+ @Column(name = "GroupName", nullable = false, length = 50)
+ private String groupName;
+
+ @Column(name = "ModifiedDate", nullable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date modifiedDate;
+
+ @Column(name = "Name", nullable = false, length = 50)
+ private String name;
+
+ public Short getDepartmentId() {
+ return departmentId;
+ }
+ public String getGroupName() {
+ return groupName;
+ }
+ public Date getModifiedDate() {
+ return modifiedDate;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
diff --git a/src/main/java/com/faf223/expensetrackerfaf/repository/BasicRepository.java b/src/main/java/com/faf223/expensetrackerfaf/repository/BasicRepository.java
new file mode 100644
index 0000000..94f10e3
--- /dev/null
+++ b/src/main/java/com/faf223/expensetrackerfaf/repository/BasicRepository.java
@@ -0,0 +1,12 @@
+package com.faf223.expensetrackerfaf.repository;
+
+import com.faf223.expensetrackerfaf.model.BasicEntity;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface BasicRepository extends JpaRepository {
+ // You can define custom query methods here if needed
+}
+
diff --git a/src/main/java/com/faf223/expensetrackerfaf/service/BasicService.java b/src/main/java/com/faf223/expensetrackerfaf/service/BasicService.java
new file mode 100644
index 0000000..a424dce
--- /dev/null
+++ b/src/main/java/com/faf223/expensetrackerfaf/service/BasicService.java
@@ -0,0 +1,9 @@
+package com.faf223.expensetrackerfaf.service;
+
+import com.faf223.expensetrackerfaf.model.BasicEntity;
+
+import java.util.List;
+
+public interface BasicService {
+ List getAllData();
+}
diff --git a/src/main/java/com/faf223/expensetrackerfaf/service/BasicServiceImpl.java b/src/main/java/com/faf223/expensetrackerfaf/service/BasicServiceImpl.java
new file mode 100644
index 0000000..8a83825
--- /dev/null
+++ b/src/main/java/com/faf223/expensetrackerfaf/service/BasicServiceImpl.java
@@ -0,0 +1,23 @@
+package com.faf223.expensetrackerfaf.service;
+
+import com.faf223.expensetrackerfaf.model.BasicEntity;
+import com.faf223.expensetrackerfaf.repository.BasicRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class BasicServiceImpl implements BasicService {
+ private final BasicRepository basicRepository;
+
+ @Autowired
+ public BasicServiceImpl(BasicRepository basicRepository) {
+ this.basicRepository = basicRepository;
+ }
+
+ @Override
+ public List getAllData() {
+ return basicRepository.findAll();
+ }
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 8b13789..4d2c5a7 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1 +1,5 @@
+spring.datasource.url=jdbc:sqlserver://DANIEL-LAPTOP\\SQLEXPRESS01:1433;databaseName=AdventureWorks2022;user=Daniel1;password=daniel;encrypt=true;trustServerCertificate=true;
+spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
+spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2008Dialect
+spring.jpa.hibernate.naming.physical-strategy=com.faf223.expensetrackerfaf.custom.UppercaseStrategy
diff --git a/src/main/resources/templates/basic-template.jsp b/src/main/resources/templates/basic-template.jsp
new file mode 100644
index 0000000..de83d98
--- /dev/null
+++ b/src/main/resources/templates/basic-template.jsp
@@ -0,0 +1,25 @@
+
+
+
+
+ Department List
+
+
+ Department List
+
+
+
+ | Department ID |
+ Name |
+ Group Name |
+ Modified Date |
+
+
+
+
+ |
+
+
+
+
+