Is it possible to use Spring AOP or AspectJ to intercept all Service methods (contained in classes in the com.app.service.*
package) having the annotation
@Transactional(readOnly = false)
(other elements possible as well in Spring's @Transactional
annotation, but we only care about readOnly = false
).
I could only find examples pertaining to pointcuts with simple Annotations, or @Annotation(value)
.
My preference would be to use straight Spring, if possible.
It would probably be something like the below, but not sure about the syntax.
@Around("execution(* com.app.service..*.*(..))" && @Transactional[??])