diff --git a/src/main/java/org/ioteatime/meonghanyangserver/group/domain/GroupEntity.java b/src/main/java/org/ioteatime/meonghanyangserver/group/domain/GroupEntity.java index 9cc47771..223906cd 100644 --- a/src/main/java/org/ioteatime/meonghanyangserver/group/domain/GroupEntity.java +++ b/src/main/java/org/ioteatime/meonghanyangserver/group/domain/GroupEntity.java @@ -8,6 +8,8 @@ import lombok.Data; import lombok.NoArgsConstructor; import org.ioteatime.meonghanyangserver.device.doamin.DeviceEntity; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; @Data @Entity @@ -15,6 +17,7 @@ @AllArgsConstructor @Builder @Table(name = "`group`") +@EntityListeners(AuditingEntityListener.class) public class GroupEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -23,8 +26,7 @@ public class GroupEntity { @Column(nullable = false, length = 100) private String groupName; - @Column(nullable = false) - private LocalDateTime createdAt; + @Column @CreatedDate private LocalDateTime createdAt; @OneToMany(mappedBy = "group") private List deviceEntities;