Skip to content

Commit 7086cc3

Browse files
committed
Replace Date with LocalDateTime
1 parent 39ff832 commit 7086cc3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/main/java/app/dto/WareTransactionDto.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import lombok.NoArgsConstructor;
1010
import org.springframework.beans.BeanUtils;
1111

12+
import java.time.LocalDateTime;
1213
import java.util.ArrayList;
13-
import java.util.Date;
1414
import java.util.List;
1515

1616
@Data
@@ -21,8 +21,8 @@ public class WareTransactionDto {
2121
private WareTransactionType wareTransactionType;
2222
private String description;
2323

24-
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
25-
private Date transactionDate;
24+
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
25+
private LocalDateTime transactionDate;
2626

2727
private Long stockClerkId;
2828
private List<WareTransactionDetailDto> wareTransactionDetails = new ArrayList<>();

src/main/java/app/model/WareTransaction.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import app.enums.WareTransactionType;
44
import lombok.Data;
5-
import org.springframework.format.annotation.DateTimeFormat;
5+
import lombok.NoArgsConstructor;
66

77
import javax.persistence.*;
8-
import java.util.Date;
8+
import java.time.LocalDateTime;
99
import java.util.List;
1010

1111
/**
@@ -27,10 +27,8 @@ public class WareTransaction {
2727
@Column(name = "description")
2828
private String description;
2929

30-
@Temporal(TemporalType.TIMESTAMP)
31-
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
3230
@Column(name = "transaction_date")
33-
private Date transactionDate;
31+
private LocalDateTime transactionDate;
3432

3533
/**
3634
* Employee that received/delivered the ware

0 commit comments

Comments
 (0)