Skip to content

Commit

Permalink
fix: 엔티티 생성시간 자동 기입 기능 추가 (#63) (KAN-114)
Browse files Browse the repository at this point in the history
  • Loading branch information
ywonchae1 committed Nov 1, 2024
1 parent 76e4caa commit 9131799
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
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
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "`group`")
@EntityListeners(AuditingEntityListener.class)
public class GroupEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand All @@ -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<DeviceEntity> deviceEntities;
Expand Down

0 comments on commit 9131799

Please sign in to comment.