Skip to content

Commit

Permalink
replace Date with LocalDate
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Mokevnin <[email protected]>
  • Loading branch information
mokevnin committed Oct 22, 2023
1 parent 05323fa commit 2669a99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/hexlet/blog/model/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static jakarta.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.time.LocalDate;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
Expand Down Expand Up @@ -58,8 +58,8 @@ public class Post implements BaseEntity {
private String body;

@LastModifiedDate
private Date updatedAt;
private LocalDate updatedAt;

@CreatedDate
private Date createdAt;
private LocalDate createdAt;
}
6 changes: 3 additions & 3 deletions src/main/java/io/hexlet/blog/model/PostComment.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static jakarta.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.time.LocalDate;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
Expand Down Expand Up @@ -46,8 +46,8 @@ public class PostComment implements BaseEntity {
private Post post;

@LastModifiedDate
private Date updatedAt;
private LocalDate updatedAt;

@CreatedDate
private Date createdAt;
private LocalDate createdAt;
}
8 changes: 3 additions & 5 deletions src/main/java/io/hexlet/blog/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static jakarta.persistence.GenerationType.IDENTITY;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import org.springframework.data.annotation.CreatedDate;
Expand All @@ -17,13 +17,11 @@
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -63,10 +61,10 @@ public class User implements UserDetails, BaseEntity {
private String passwordDigest;

@LastModifiedDate
private Date updatedAt;
private LocalDate updatedAt;

@CreatedDate
private Date createdAt;
private LocalDate createdAt;

@Override
public String getPassword() {
Expand Down

0 comments on commit 2669a99

Please sign in to comment.