Skip to content

Commit 55b8382

Browse files
committed
update spring-boot version
1 parent d0b393a commit 55b8382

File tree

8 files changed

+23
-14
lines changed

8 files changed

+23
-14
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ mvn spring-boot:run
1111

1212
```
1313

14+
* Open [swagger-ui](http://localhost:8080/swagger-ui/index.html) test the application.
15+
1416
## ManyToOne
1517

1618
* User Table

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.ashu.practice</groupId>
88
<artifactId>spring-data-jpa-mapping</artifactId>
9-
<version>3.0.0</version>
9+
<version>3.1.0</version>
1010
<packaging>jar</packaging>
1111

1212
<name>spring-data-jpa-mapping</name>
@@ -15,13 +15,14 @@
1515
<parent>
1616
<groupId>org.springframework.boot</groupId>
1717
<artifactId>spring-boot-starter-parent</artifactId>
18-
<version>3.1.1</version>
18+
<version>3.5.4</version>
1919
<relativePath/> <!-- lookup parent from repository -->
2020
</parent>
2121

2222
<properties>
23-
<java.version>17</java.version>
24-
<mapstruct.version>1.5.5.Final</mapstruct.version>
23+
<java.version>21</java.version>
24+
<mapstruct.version>1.6.3</mapstruct.version>
25+
<springdoc.version>2.8.9</springdoc.version>
2526
</properties>
2627

2728
<dependencies>
@@ -37,6 +38,11 @@
3738
<groupId>org.springframework.boot</groupId>
3839
<artifactId>spring-boot-starter-web</artifactId>
3940
</dependency>
41+
<dependency>
42+
<groupId>org.springdoc</groupId>
43+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
44+
<version>${springdoc.version}</version>
45+
</dependency>
4046
<dependency>
4147
<groupId>org.mapstruct</groupId>
4248
<artifactId>mapstruct</artifactId>
@@ -47,12 +53,6 @@
4753
<artifactId>h2</artifactId>
4854
<scope>runtime</scope>
4955
</dependency>
50-
<!-- <dependency>-->
51-
<!-- <groupId>org.springframework.boot</groupId>-->
52-
<!-- <artifactId>spring-boot-devtools</artifactId>-->
53-
<!-- <scope>runtime</scope>-->
54-
<!-- <optional>true</optional>-->
55-
<!-- </dependency>-->
5656
<dependency>
5757
<groupId>org.projectlombok</groupId>
5858
<artifactId>lombok</artifactId>

src/main/java/com/ashu/one2many/controller/PostController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.List;
1212

1313
@RestController
14-
@RequestMapping(path = "/api/v1/posts", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
14+
@RequestMapping(path = "/api/v1/posts")
1515
@RequiredArgsConstructor
1616
@Slf4j
1717
public class PostController {

src/main/java/com/ashu/one2many/controller/UserController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.List;
1212

1313
@RestController
14-
@RequestMapping(path = "/api/v1/users", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
14+
@RequestMapping(path = "/api/v1/users")
1515
@Slf4j
1616
@RequiredArgsConstructor
1717
public class UserController {

src/main/java/com/ashu/one2one/controller/EmployeeController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.List;
1212

1313
@RestController
14-
@RequestMapping(path = "/api/v1/employees", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
14+
@RequestMapping(path = "/api/v1/employees")
1515
@RequiredArgsConstructor
1616
@Slf4j
1717
public class EmployeeController {

src/main/java/com/ashu/one2one/controller/LockerController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.List;
1212

1313
@RestController
14-
@RequestMapping(path = "/api/v1/lockers", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
14+
@RequestMapping(path = "/api/v1/lockers")
1515
@RequiredArgsConstructor
1616
@Slf4j
1717
public class LockerController {

src/main/java/com/ashu/one2one/service/LockerServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import lombok.RequiredArgsConstructor;
1010
import lombok.extern.slf4j.Slf4j;
1111
import org.springframework.stereotype.Service;
12+
import org.springframework.transaction.annotation.Transactional;
1213

1314
import java.util.List;
1415

@@ -21,6 +22,7 @@ public class LockerServiceImpl implements LockerService {
2122

2223
private final EmployeeService employeeService;
2324

25+
@Transactional
2426
@Override
2527
public LockerDto create(CreateLocker createLocker) {
2628
Employee employee = employeeService.findById(createLocker.getEmployeeId());

src/main/resources/application.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ server:
44
spring:
55
jpa:
66
open-in-view: false
7+
generate-ddl: true
78
properties:
89
hibernate:
910
show_sql: true
1011
format_sql: true
12+
use_sql_comments: true
1113
jdbc:
1214
time_zone: UTC
15+
ddl-auto: create-drop
16+
hbm2dll:
17+
create_namespaces: true
1318

1419
datasource:
1520
url: jdbc:h2:mem:testdb

0 commit comments

Comments
 (0)