Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

개발자되기 프로젝트

@Transactional을 Interface에 적용한 경우 본문

JPA/영속성

@Transactional을 Interface에 적용한 경우

Seung__ 2021. 7. 10. 13:45

The Stpring team recommends that you annotate only concrete classeds with the @Transactinal annotation as apposed to annotating interfaces.

 

you certainly can place the @Transactional annotation on an interface( or an interface method),

but this works only as you would expect it to if you use inferface-based proxies.

 

 

1. @Transactional은 interface보다는 구체 class에 사용하는 것을 권장

 

2. interface는, interface-based proxies인 경우만 사용이 가능

 

JPA는 Interface-based proxy의 형태로 적용되기 때문에

 

interface에 @Transactional을 붙여도 문제는 없다.

'JPA > 영속성' 카테고리의 다른 글

Cascade Remove, Orphan Removal, Soft Delete, @Where  (0) 2021.07.08
Transaction Manager - 5 : Propagation  (0) 2021.07.06
Transaction Manager - 4 : Isolation  (0) 2021.07.05
Transaction Manager-3 : Isolation  (0) 2021.07.04
Transaction Manager - 2  (0) 2021.07.04
Comments