Java Doc for AbstractEntityManagerFactoryBean.java in  » J2EE » spring-framework-2.0.6 » org » springframework » orm » jpa » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.orm.jpa 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.orm.jpa.AbstractEntityManagerFactoryBean

All known Subclasses:   org.springframework.orm.jpa.LocalEntityManagerFactoryBean,  org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean,
AbstractEntityManagerFactoryBean
abstract public class AbstractEntityManagerFactoryBean implements FactoryBean,InitializingBean,DisposableBean,EntityManagerFactoryInfo,PersistenceExceptionTranslator(Code)
Abstract org.springframework.beans.factory.FactoryBean that creates a local JPA javax.persistence.EntityManagerFactory instance within a Spring application context.

Encapsulates the common functionality between the different JPA bootstrap contracts (standalone as well as container).

Implements support for standard JPA configuration as well as Spring's JpaVendorAdapter abstraction, and controls the EntityManagerFactory's lifecycle.

This class also implements the org.springframework.dao.support.PersistenceExceptionTranslator interface, as autodetected by Spring's org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor , for AOP-based translation of native exceptions to Spring DataAccessExceptions. Hence, the presence of e.g. LocalEntityManagerFactoryBean automatically enables a PersistenceExceptionTranslationPostProcessor to translate JPA exceptions.
author:
   Juergen Hoeller
author:
   Rod Johnson
since:
   2.0
See Also:   LocalEntityManagerFactoryBean
See Also:   LocalContainerEntityManagerFactoryBean



Field Summary
final protected  Loglogger
    
public  EntityManagerFactorynativeEntityManagerFactory
    


Method Summary
final public  voidafterPropertiesSet()
    
protected  EntityManagerFactorycreateEntityManagerFactoryProxy(EntityManagerFactory emf)
     Create a proxy of the given EntityManagerFactory.
abstract protected  EntityManagerFactorycreateNativeEntityManagerFactory()
    
public  voiddestroy()
     Close the EntityManagerFactory on bean factory shutdown.
public  DataSourcegetDataSource()
    
public  Class<? extends EntityManager>getEntityManagerInterface()
    
public  JpaDialectgetJpaDialect()
    
public  MapgetJpaPropertyMap()
     Allow Map access to the JPA properties to be passed to the persistence provider, with the option to add or override specific entries.
public  EntityManagerFactorygetNativeEntityManagerFactory()
    
public  EntityManagerFactorygetObject()
     Return the singleton EntityManagerFactory.
public  ClassgetObjectType()
    
public  PersistenceProvidergetPersistenceProvider()
    
public  PersistenceUnitInfogetPersistenceUnitInfo()
    
public  StringgetPersistenceUnitName()
    
public  booleanisSingleton()
    
public  voidsetEntityManagerInterface(Class<? extends EntityManager> entityManagerInterface)
     Specify the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers are supposed to implement.
public  voidsetJpaDialect(JpaDialect jpaDialect)
     Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory.
public  voidsetJpaProperties(Properties jpaProperties)
     Specify JPA properties, to be passed into Persistence.createEntityManagerFactory (if any).
public  voidsetJpaPropertyMap(Map jpaProperties)
     Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory (if any).
public  voidsetJpaVendorAdapter(JpaVendorAdapter jpaVendorAdapter)
     Specify the JpaVendorAdapter implementation for the desired JPA provider, if any.
public  voidsetPersistenceProvider(PersistenceProvider persistenceProvider)
     Set the PersistenceProvider instance to use for creating the EntityManagerFactory.
public  voidsetPersistenceProviderClass(Class<? extends PersistenceProvider> persistenceProviderClass)
     Set the PersistenceProvider implementation class to use for creating the EntityManagerFactory.
public  voidsetPersistenceUnitName(String persistenceUnitName)
     Specify the name of the EntityManagerFactory configuration.

Default is none, indicating the default EntityManagerFactory configuration.

public  DataAccessExceptiontranslateExceptionIfPossible(RuntimeException ex)
     Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.

Field Detail
logger
final protected Log logger(Code)
Logger available to subclasses



nativeEntityManagerFactory
public EntityManagerFactory nativeEntityManagerFactory(Code)
Raw EntityManagerFactory as returned by the PersistenceProvider





Method Detail
afterPropertiesSet
final public void afterPropertiesSet() throws PersistenceException(Code)



createEntityManagerFactoryProxy
protected EntityManagerFactory createEntityManagerFactoryProxy(EntityManagerFactory emf)(Code)
Create a proxy of the given EntityManagerFactory. We do this to be able to return transaction-aware proxies for application-managed EntityManagers, and to introduce the NamedEntityManagerFactory interface
Parameters:
  emf - EntityManagerFactory as returned by the persistence provider proxy entity manager



createNativeEntityManagerFactory
abstract protected EntityManagerFactory createNativeEntityManagerFactory() throws PersistenceException(Code)
Subclasses must implement this method to create the EntityManagerFactory that will be returned by the getObject() method EntityManagerFactory instance returned by this FactoryBean
throws:
  PersistenceException - if the EntityManager cannot be created



destroy
public void destroy()(Code)
Close the EntityManagerFactory on bean factory shutdown.



getDataSource
public DataSource getDataSource()(Code)



getEntityManagerInterface
public Class<? extends EntityManager> getEntityManagerInterface()(Code)



getJpaDialect
public JpaDialect getJpaDialect()(Code)



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]".




getNativeEntityManagerFactory
public EntityManagerFactory getNativeEntityManagerFactory()(Code)



getObject
public EntityManagerFactory getObject()(Code)
Return the singleton EntityManagerFactory.



getObjectType
public Class getObjectType()(Code)



getPersistenceProvider
public PersistenceProvider getPersistenceProvider()(Code)



getPersistenceUnitInfo
public PersistenceUnitInfo getPersistenceUnitInfo()(Code)



getPersistenceUnitName
public String getPersistenceUnitName()(Code)



isSingleton
public boolean isSingleton()(Code)



setEntityManagerInterface
public void setEntityManagerInterface(Class<? extends EntityManager> entityManagerInterface)(Code)
Specify the (potentially vendor-specific) EntityManager interface that this factory's EntityManagers are supposed to implement.

The default will be taken from the specific JpaVendorAdapter, if any, or set to the standard javax.persistence.EntityManager interface else.
See Also:   JpaVendorAdapter.getEntityManagerInterface
See Also:   EntityManagerFactoryInfo.getEntityManagerInterface




setJpaDialect
public void setJpaDialect(JpaDialect jpaDialect)(Code)
Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory. This will be exposed through the EntityManagerFactoryInfo interface, to be picked up as default dialect by accessors that intend to use JpaDialect functionality.
See Also:   EntityManagerFactoryInfo.getJpaDialect



setJpaProperties
public void setJpaProperties(Properties jpaProperties)(Code)
Specify JPA properties, to be passed into Persistence.createEntityManagerFactory (if any).

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.
See Also:   javax.persistence.Persistence.createEntityManagerFactory(Stringjava.util.Map)
See Also:   javax.persistence.spi.PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfojava.util.Map)




setJpaPropertyMap
public void setJpaPropertyMap(Map jpaProperties)(Code)
Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory (if any).

Can be populated with a "map" or "props" element in XML bean definitions.
See Also:   javax.persistence.Persistence.createEntityManagerFactory(Stringjava.util.Map)
See Also:   javax.persistence.spi.PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfojava.util.Map)




setJpaVendorAdapter
public void setJpaVendorAdapter(JpaVendorAdapter jpaVendorAdapter)(Code)
Specify the JpaVendorAdapter implementation for the desired JPA provider, if any. This will initialize appropriate defaults for the given provider, such as persistence provider class and JpaDialect, unless locally overridden in this FactoryBean.



setPersistenceProvider
public void setPersistenceProvider(PersistenceProvider persistenceProvider)(Code)
Set the PersistenceProvider instance to use for creating the EntityManagerFactory. If not specified, the persistence provider will be taken from the JpaVendorAdapter (if any) or determined by the persistence unit deployment descriptor (as far as possible).
See Also:   JpaVendorAdapter.getPersistenceProvider
See Also:   javax.persistence.spi.PersistenceProvider
See Also:   javax.persistence.Persistence



setPersistenceProviderClass
public void setPersistenceProviderClass(Class<? extends PersistenceProvider> persistenceProviderClass)(Code)
Set the PersistenceProvider implementation class to use for creating the EntityManagerFactory. If not specified, the persistence provider will be taken from the JpaVendorAdapter (if any) or retrieved through scanning (as far as possible).
See Also:   JpaVendorAdapter.getPersistenceProvider
See Also:   javax.persistence.spi.PersistenceProvider
See Also:   javax.persistence.Persistence



setPersistenceUnitName
public void setPersistenceUnitName(String persistenceUnitName)(Code)
Specify the name of the EntityManagerFactory configuration.

Default is none, indicating the default EntityManagerFactory configuration. The persistence provider will throw an exception if ambiguous EntityManager configurations are found.
See Also:   javax.persistence.Persistence.createEntityManagerFactory(String)




translateExceptionIfPossible
public DataAccessException translateExceptionIfPossible(RuntimeException ex)(Code)
Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor.

Uses the dialect's conversion if possible; otherwise falls back to standard JPA exception conversion.
See Also:   org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
See Also:   JpaDialect.translateExceptionIfPossible
See Also:   EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.