Skip to content

Commit

Permalink
TemporalType.TIMESTAMP - LocalDate가 호환되지 않는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
One-armed-boy committed Mar 8, 2024
1 parent 7ce91b3 commit 15b7dae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/tiketeer/Tiketeer/domain/member/Member.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tiketeer.Tiketeer.domain.member;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.UUID;

import org.hibernate.annotations.CreationTimestamp;
Expand Down Expand Up @@ -57,12 +57,12 @@ public class Member {
@CreationTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_at", nullable = false)
private LocalDate createdAt;
private LocalDateTime createdAt;

@Setter
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "last_login_at")
private LocalDate lastLoginAt;
private LocalDateTime lastLoginAt;

@Setter
@ManyToOne
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/tiketeer/Tiketeer/domain/member/Otp.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tiketeer.Tiketeer.domain.member;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.UUID;

import org.hibernate.annotations.CreationTimestamp;
Expand Down Expand Up @@ -35,19 +35,19 @@ public class Otp {
@CreationTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_at", nullable = false)
private LocalDate createdAt;
private LocalDateTime createdAt;

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "expired_at", nullable = false)
private LocalDate expiredAt;
private LocalDateTime expiredAt;

@OneToOne
@Setter
@JoinColumn(name = "member_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
private Member member;

@Builder
public Otp(LocalDate expiredAt, Member member) {
public Otp(LocalDateTime expiredAt, Member member) {
this.expiredAt = expiredAt;
this.member = member;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tiketeer.Tiketeer.domain.role;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.UUID;

import org.hibernate.annotations.CreationTimestamp;
Expand Down Expand Up @@ -39,12 +39,12 @@ public class Permission {
@CreationTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_at", nullable = false)
private LocalDate createdAt;
private LocalDateTime createdAt;

@UpdateTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "updated_at", nullable = false)
private LocalDate updatedAt;
private LocalDateTime updatedAt;

@Builder
public Permission(PermissionEnum name) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/tiketeer/Tiketeer/domain/role/Role.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tiketeer.Tiketeer.domain.role;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -44,12 +44,12 @@ public class Role {
@CreationTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_at", nullable = false)
private LocalDate createdAt;
private LocalDateTime createdAt;

@UpdateTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "updated_at", nullable = false)
private LocalDate updatedAt;
private LocalDateTime updatedAt;

@Builder
public Role(RoleEnum name) {
Expand Down

0 comments on commit 15b7dae

Please sign in to comment.