| java.lang.Object org.springframework.orm.jpa.EntityManagerFactoryAccessor
All known Subclasses: org.springframework.orm.jpa.support.SharedEntityManagerBean, org.springframework.orm.jpa.JpaAccessor, org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor,
EntityManagerFactoryAccessor | abstract public class EntityManagerFactoryAccessor (Code) | | Base class for any class that needs to access an EntityManagerFactory,
usually in order to obtain an EntityManager. Defines common properties.
Not intended to be used directly. See JpaAccessor.
author: Juergen Hoeller since: 2.0 See Also: JpaAccessor See Also: EntityManagerFactoryUtils |
Field Summary | |
final protected Log | logger |
Method Summary | |
protected EntityManager | createEntityManager() Obtain a new EntityManager from this accessor's EntityManagerFactory. | public EntityManagerFactory | getEntityManagerFactory() Return the JPA EntityManagerFactory that should be used to create
EntityManagers. | public Map | getJpaPropertyMap() Allow Map access to the JPA properties to be passed to the persistence
provider, with the option to add or override specific entries. | protected EntityManager | getTransactionalEntityManager() Obtain the transactional EntityManager for this accessor's EntityManagerFactory, if any. | public void | setEntityManagerFactory(EntityManagerFactory emf) Set the JPA EntityManagerFactory that should be used to create
EntityManagers. | public void | setJpaProperties(Properties jpaProperties) Specify JPA properties, to be passed into
EntityManagerFactory.createEntityManager(Map) (if any). | public void | setJpaPropertyMap(Map jpaProperties) Specify JPA properties as a Map, to be passed into
EntityManagerFactory.createEntityManager(Map) (if any). |
logger | final protected Log logger(Code) | | Logger available to subclasses
|
createEntityManager | protected EntityManager createEntityManager() throws IllegalStateException(Code) | | Obtain a new EntityManager from this accessor's EntityManagerFactory.
Can be overridden in subclasses to create specific EntityManager variants.
a new EntityManager throws: IllegalStateException - if this accessor is not configured with an EntityManagerFactory See Also: javax.persistence.EntityManagerFactory.createEntityManager See Also: javax.persistence.EntityManagerFactory.createEntityManager(java.util.Map) |
getEntityManagerFactory | public EntityManagerFactory getEntityManagerFactory()(Code) | | Return the JPA EntityManagerFactory that should be used to create
EntityManagers.
|
getJpaPropertyMap | public Map getJpaPropertyMap()(Code) | | Allow Map access to the JPA properties to be passed to the persistence
provider, with the option to add or override specific entries.
Useful for specifying entries directly, for example via "jpaPropertyMap[myKey]".
|
setEntityManagerFactory | public void setEntityManagerFactory(EntityManagerFactory emf)(Code) | | Set the JPA EntityManagerFactory that should be used to create
EntityManagers.
See Also: javax.persistence.EntityManagerFactory.createEntityManager See Also: javax.persistence.EntityManagerFactory.createEntityManager(java.util.Map) |
setJpaProperties | public void setJpaProperties(Properties jpaProperties)(Code) | | Specify JPA properties, to be passed into
EntityManagerFactory.createEntityManager(Map) (if any).
Can be populated with a String "value" (parsed via PropertiesEditor)
or a "props" element in XML bean definitions.
See Also: javax.persistence.EntityManagerFactory.createEntityManager(java.util.Map) |
setJpaPropertyMap | public void setJpaPropertyMap(Map jpaProperties)(Code) | | Specify JPA properties as a Map, to be passed into
EntityManagerFactory.createEntityManager(Map) (if any).
Can be populated with a "map" or "props" element in XML bean definitions.
See Also: javax.persistence.EntityManagerFactory.createEntityManager(java.util.Map) |
|
|