Skip to content

Commit

Permalink
feature: refactor models, so they return Date-time format values for …
Browse files Browse the repository at this point in the history
…audit columns

Task: 86972yq1k
  • Loading branch information
KinTrae committed Dec 21, 2024
1 parent 3a53d56 commit a67235f
Show file tree
Hide file tree
Showing 31 changed files with 121 additions and 132 deletions.
5 changes: 5 additions & 0 deletions backend/src/main/java/meowhub/backend/dtos/RelationType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package meowhub.backend.dtos;

public enum RelationType {
SENT_INVITATION, FRIENDS, REJECTED,
}
6 changes: 3 additions & 3 deletions backend/src/main/java/meowhub/backend/jpa_buddy/Chatroom.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand Down Expand Up @@ -54,14 +54,14 @@ public class Chatroom {
private String receiverNick;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand Down Expand Up @@ -50,24 +50,20 @@ public class ChatroomMessage {
@Column(name = "MESSAGE", nullable = false, length = 2000)
private String message;

@NotNull
@Column(name = "MSG_DATE", nullable = false)
private LocalDate msgDate;

@ManyToOne(fetch = FetchType.LAZY)
@OnDelete(action = OnDeleteAction.RESTRICT)
@JoinColumn(name = "ANSWERED_MESSAGE_ID")
private ChatroomMessage answeredMessage;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
10 changes: 3 additions & 7 deletions backend/src/main/java/meowhub/backend/jpa_buddy/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand Down Expand Up @@ -52,19 +52,15 @@ public class Group {
@JoinColumn(name = "PICTURE_ID", nullable = false)
private Picture picture;

@NotNull
@Column(name = "CREATE_DATE", nullable = false)
private LocalDate createDate;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand Down Expand Up @@ -55,19 +55,15 @@ public class GroupchatMessage {
@JoinColumn(name = "ANSWERED_MESSAGE_ID")
private GroupchatMessage answeredMessage;

@NotNull
@Column(name = "MSG_DATE", nullable = false)
private LocalDate msgDate;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
6 changes: 3 additions & 3 deletions backend/src/main/java/meowhub/backend/jpa_buddy/LikeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand All @@ -33,14 +33,14 @@ public class LikeType {
private String code;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
10 changes: 3 additions & 7 deletions backend/src/main/java/meowhub/backend/jpa_buddy/Liked.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@Setter
Expand Down Expand Up @@ -47,19 +47,15 @@ public class Liked {
@JoinColumn(name = "LIKE_TYPE_ID", nullable = false)
private LikeType likeType;

@NotNull
@Column(name = "LIKED_DATE", nullable = false)
private LocalDate likedDate;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand All @@ -44,19 +44,15 @@ public class MatchingChat {
@JoinColumn(name = "RECEIVER_ID", nullable = false)
private MatchingProfile receiver;

@NotNull
@Column(name = "SEND_DATE")
private LocalDate sendDate;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@Setter
Expand Down Expand Up @@ -47,14 +47,14 @@ public class MatchingChatMessage {
private String message;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand All @@ -44,14 +44,14 @@ public class MatchingProfile {
private String profileDetailsHtml;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@Setter
Expand Down Expand Up @@ -49,19 +49,15 @@ public class MatchingProfilePicture {
@Column(name = "PICTURE_INDEX", nullable = false)
private Long index;

@NotNull
@Column(name = "POST_DATE", nullable = false)
private LocalDate postDate;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
6 changes: 3 additions & 3 deletions backend/src/main/java/meowhub/backend/jpa_buddy/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand All @@ -45,14 +45,14 @@ public class Profile {
private String profileDetailsHtml;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.LinkedHashSet;
import java.util.Set;

Expand All @@ -33,14 +33,14 @@ public class ProfileData {
private String code;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@Setter
Expand Down Expand Up @@ -47,14 +47,14 @@ public class ProfilePicture {
private Long index;

@Column(name = "CREATED_AT")
private LocalDate createdAt;
private LocalDateTime createdAt;

@Size(max = 36)
@Column(name = "CREATED_BY", length = 36)
private String createdBy;

@Column(name = "MODIFIED_AT")
private LocalDate modifiedAt;
private LocalDateTime modifiedAt;

@Size(max = 36)
@Column(name = "MODIFIED_BY", length = 36)
Expand Down
Loading

0 comments on commit a67235f

Please sign in to comment.