【发布时间】:2015-07-01 07:50:06
【问题描述】:
有人知道如何为 CDI 中的几个注释创建“快捷方式”吗?
你知道,在 Spring 世界中称为 meta-annotations 的东西:
@Singleton
@Transactional(value = TxType.REQUIRED, dontRollbackOn = SomeException.class)
@SomeOtherAnnotations
public @interface MyService {
// ...
}
@MyService
public class OrderService {
// ...
}
目标很明显:只是不必在每个类中指定相同的设置。据我所知,这在 CDI 中是不可能的,但是有人知道 EJB 3.2 是否支持类似的东西吗?
【问题讨论】: