网络 持久化上下文中;注解
You can use code assist to bring in the PersistenceContext Import (Figure 52).
您可以使用代码辅助功能引入PersistenceContext导入(图52)。
The @PersistenceContext annotation of the EntityManager object ensures that the Blueprint container injects this object, ready for use, into the bundle at run time.
EntityManager 对象的 @PersistenceContext 注释确保 Blueprint 在运行时将这个对象(准备使用)注入到捆绑包。
The @PersistenceContext annotation has an optional attribute type, which defaults to PersistenceContextType.TRANSACTION (that is, a transaction-bound persistence context).
@PersistenceContext 注释有一个可选的属性 type,该属性默认为 PersistenceContextType.TRANSACTION(也就是绑定到事务的持久化上下文)。