jpa
-
@Transactional 롤백/커밋 테스트jpa/Spring Data JPA 2023. 7. 19. 17:46
application프로퍼티에서 org.springframework 패키지를 debug로 잡으면 로그가 많이 남기때문에 TransactionManager에 대해서만 debug로 잡고 테스트 @Rollback(true)인 경우 package study.hibernate.springdatajpa.transaction; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.a..
-
@ManyToOne(optional=false)/@JoinColumn(nullable=false)jpa/Hibernate 2023. 5. 28. 20:55
Team @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor @Entity class Team { @Id private Integer id; private String name; @OneToMany(mappedBy = "team") private List member; } Member @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor @Entity class Member { @Id private Integer id; private String name; @ManyToOne @JoinColumn(name = "team_id") private Team team; } 1. 기본 cre..