Springのドキュメントで説明されているように、独自のカスタムショートカットアノテーションを作成しています。
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Transactional(value = "Custom", readOnly = true)
public @interface CustomTransactional {
}
カスタムアノテーションを使用して、で使用可能な他の属性を設定することもできます@Transactional
か?たとえば、次のように注釈を使用できるようにしたいと思います。
@CustomTransactional(propagation = Propagation.REQUIRED)
public class MyClass {
}