From eedd4f297711ccbf0a2f6e9722852e53cac1350b Mon Sep 17 00:00:00 2001 From: hawardShin Date: Wed, 27 Nov 2024 15:25:15 +0900 Subject: [PATCH] Feat: Set Order By --- src/main/java/capstone/relation/document/domain/Folder.java | 2 ++ src/main/java/capstone/relation/workspace/WorkSpace.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/capstone/relation/document/domain/Folder.java b/src/main/java/capstone/relation/document/domain/Folder.java index 233858d..b907882 100644 --- a/src/main/java/capstone/relation/document/domain/Folder.java +++ b/src/main/java/capstone/relation/document/domain/Folder.java @@ -16,6 +16,7 @@ import jakarta.persistence.Id; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; +import jakarta.persistence.OrderBy; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Builder; @@ -45,6 +46,7 @@ public class Folder extends BaseEntity { @OneToMany(mappedBy = "folder") @Builder.Default + @OrderBy("id ASC") private List fileInfos = new ArrayList<>(); @ManyToOne(fetch = FetchType.LAZY) diff --git a/src/main/java/capstone/relation/workspace/WorkSpace.java b/src/main/java/capstone/relation/workspace/WorkSpace.java index 4191190..7bf2ae7 100644 --- a/src/main/java/capstone/relation/workspace/WorkSpace.java +++ b/src/main/java/capstone/relation/workspace/WorkSpace.java @@ -18,6 +18,7 @@ import jakarta.persistence.Id; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; +import jakarta.persistence.OrderBy; import lombok.Getter; @Entity @@ -40,6 +41,7 @@ public class WorkSpace { private Set meetRooms = new HashSet<>(); @OneToMany(mappedBy = "workSpace", cascade = CascadeType.ALL) + @OrderBy("id ASC") private List folders = new ArrayList<>(); @Column(nullable = false)