@PersistenceContext
来源:互联网 发布:淘宝返利软件 编辑:程序博客网 时间:2024/05/16 09:25
javax.persistence
Annotation Type PersistenceContext
@Target(value={TYPE,METHOD,FIELD})@Retention(value=RUNTIME)public @interface PersistenceContext
Expresses a dependency on a container-managed EntityManager
and its associated persistence context.
- Since:
- Java Persistence 1.0
java.lang.String
name
(Optional) The name by which the entity manager is to be accessed in the environment referencing context; not needed when dependency injection is used.
PersistenceProperty[]
properties
(Optional) Properties for the container or persistence provider.
PersistenceContextType
type
(Optional) Specifies whether a transaction-scoped persistence context or an extended persistence context is to be used.
java.lang.String
unitName
(Optional) The name of the persistence unit as defined in the
persistence.xml
file. name
public abstract java.lang.String name
- (Optional) The name by which the entity manager is to be accessed in the environment referencing context; not needed when dependency injection is used.
- Default:
- ""
unitName
public abstract java.lang.String unitName
- (Optional) The name of the persistence unit as defined in the
persistence.xml
file. If theunitName
element is specified, the persistence unit for the entity manager that is accessible in JNDI must have the same name. - Default:
- ""
type
public abstract PersistenceContextType type
- (Optional) Specifies whether a transaction-scoped persistence context or an extended persistence context is to be used.
- Default:
- javax.persistence.PersistenceContextType.TRANSACTION
properties
public abstract PersistenceProperty[] properties
- (Optional) Properties for the container or persistence provider. Vendor specific properties may be included in this set of properties. Properties that are not recognized by a vendor are ignored.
- Default:
- {}
- @PersistenceContext
- @PersistenceContext(unitName = "entityManagerFactory")
- JPA @PersistenceContext及@Transactional Annotation
- JPA @PersistenceContext及@Transactional Annotation
- JPA @PersistenceContext及@Transactional Annotation
- JPA @PersistenceContext及@Transactional Annotation
- JPA @PersistenceContext及@Transactional Annotation
- JPA @PersistenceContext及@Transactional Annotation
- 注入EntityManager--@PersistenceContext protected EntityManager em;
- 注入EntityManager--@PersistenceContext protected EntityManager em;
- 使用@PersistenceContext获取EntityManager报NullPointerException异常
- java.lang.NoSuchMethodError: javax.persistence.PersistenceContext.properties()
- Don't use @PersistenceContext in a web app...
- 往DAO类中注入@PersistenceContext和@Resource的区别
- hibernate的增删改查EntityManager怎么注入JPA @PersistenceContext
- 往DAO类中注入EntityManager为什么用@PersistenceContext,能不能用@Resource注入,两者有什么区别
- J2ME实现联网功能
- SQL Server CHARINDEX和PATINDEX详解
- 改变对话框的系统菜单:程序运行时,在任务栏中的图标右键时弹出的菜单或是程序左上角左键弹出的菜单
- 设置imagebutton的alpha
- linux led子系统
- @PersistenceContext
- linux批量重命名多个目录下文件名
- HOS服务器部署
- libnids tcp 重组代码注释
- SQL调整的目标
- 总结 vb与数据库的连接方法
- js选择题
- 调用百度地图出现java.lang.UnsatisfiedLinkError: initClass
- 双节点rhel5_x64_11gr2_grid_asm 安装文档