File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/main/java/clap/server/adapter/outbound/persistense Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,9 @@ public Comment saveComment(Comment comment) {
2929 CommentEntity commentEntity = commentRepository .save (commentPersistenceMapper .toEntity (comment ));
3030 return commentPersistenceMapper .toDomain (commentEntity );
3131 }
32+
33+ @ Override
34+ public void deleteComment (Comment comment ) {
35+ commentRepository .delete (commentPersistenceMapper .toEntity (comment ));
36+ }
3237}
Original file line number Diff line number Diff line change 77import lombok .Getter ;
88import lombok .NoArgsConstructor ;
99import lombok .experimental .SuperBuilder ;
10+ import org .hibernate .annotations .SQLDelete ;
1011
1112@ Entity
1213@ Table (name = "comment" )
1314@ Getter
1415@ SuperBuilder
1516@ NoArgsConstructor (access = AccessLevel .PROTECTED )
17+ @ SQLDelete (sql = "UPDATE Comment SET is_Deleted = true WHERE comment_id = ?" )
1618public class CommentEntity extends BaseTimeEntity {
1719 @ Id
1820 @ GeneratedValue (strategy = GenerationType .IDENTITY )
@@ -34,5 +36,5 @@ public class CommentEntity extends BaseTimeEntity {
3436 private boolean isModified ;
3537
3638 @ Column (name ="is_deleted" , nullable = false )
37- private boolean isDeleted ;
39+ private boolean isDeleted = Boolean . FALSE ;
3840}
You can’t perform that action at this time.
0 commit comments