【发布时间】:2014-02-02 13:10:44
【问题描述】:
我正在扩展 hibernate.EmptyInterceptor 并且在我的实现中我希望自动连接到一些服务,但它们返回 null。我在类上添加了一个 @Component 注释。我的代码:
<property name="jpaPropertyMap">
<map>
<entry key="javax.persistence.transactionType" value="JTA" />
<entry key="hibernate.current_session_context_class" value="jta" />
<entry key="hibernate.transaction.manager_lookup_class"
value="com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup" />
<entry key="hibernate.connection.autocommit" value="false" />
<entry key="hibernate.ejb.interceptor" value="com.net.filter.AuditInterceptor"/>
</map>
</property>
和班级:
@SuppressWarnings("serial")
@Component
public class AuditInterceptor extends EmptyInterceptor {
@Autowired
private IUserSessionService userSessionService;
【问题讨论】:
标签: java spring hibernate interceptor