Skip to content

Commit

Permalink
[fix][#29] soft delete 적용:
Browse files Browse the repository at this point in the history
  • Loading branch information
sejoon00 committed Aug 12, 2024
1 parent 0670119 commit 43d4cb9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLRestriction;

@Getter
@Entity
@SQLRestriction("deleted = false")
@SQLDelete(sql = "UPDATE recruit SET deleted = true WHERE id = ?")
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Recruit extends BaseEntity {

Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/application-datasource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
password: ${MYSQL_PASSWORD}
username: ${MYSQL_USERNAME}

jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect
7 changes: 4 additions & 3 deletions src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ spring:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.H2Dialect

cloud:
aws:
Expand Down

0 comments on commit 43d4cb9

Please sign in to comment.