org.hibernate.ejb
Class Ejb3Configuration

java.lang.Object
  extended by org.hibernate.ejb.Ejb3Configuration
All Implemented Interfaces:
Serializable, Referenceable

Deprecated. Direct usage of this class has never been supported. Instead, the application should obtain reference to the EntityManagerFactory as outlined in the JPA specification, section 7.3 Obtaining an Entity Manager Factory based on runtime environment. Additionally this class will be removed in Hibernate release 5.0 for the same reasoning outlined on Configuration due to move towards new SessionFactory building methodology. See HHH-6181 and HHH-6159 for details

@Deprecated
public class Ejb3Configuration
extends Object
implements Serializable, Referenceable

Allow a fine tuned configuration of an EJB 3.0 EntityManagerFactory A Ejb3Configuration object is only guaranteed to create one EntityManagerFactory. Multiple usage of buildEntityManagerFactory() is not guaranteed. After #buildEntityManagerFactory() has been called, you no longer can change the configuration state (no class adding, no property change etc) When serialized / deserialized or retrieved from the JNDI, you no longer can change the configuration state (no class adding, no property change etc) Putting the configuration in the JNDI is an expensive operation that requires a partial serialization

See Also:
Serialized Form

Constructor Summary
Ejb3Configuration()
          Deprecated.  
 
Method Summary
 Ejb3Configuration addAnnotatedClass(Class persistentClass)
          Deprecated.  
 void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject object)
          Deprecated.  
 Ejb3Configuration addClass(Class persistentClass)
          Deprecated.  
 Ejb3Configuration addFile(File xmlFile)
          Deprecated.  
 Ejb3Configuration addFile(String xmlFile)
          Deprecated.  
 void addFilterDefinition(FilterDefinition definition)
          Deprecated.  
 Ejb3Configuration addInputStream(InputStream xmlInputStream)
          Deprecated.  
 Ejb3Configuration addPackage(String packageName)
          Deprecated.  
 Ejb3Configuration addProperties(Properties props)
          Deprecated.  
 Ejb3Configuration addResource(String path)
          Deprecated.  
 Ejb3Configuration addResource(String path, ClassLoader classLoader)
          Deprecated.  
 EntityManagerFactory buildEntityManagerFactory()
          Deprecated.  
 EntityManagerFactory buildEntityManagerFactory(BootstrapServiceRegistryBuilder builder)
          Deprecated.  
 void buildMappings()
          Deprecated.  
 Ejb3Configuration configure(Map configValues)
          Deprecated.  
 Ejb3Configuration configure(PersistenceMetadata metadata, Map overridesIn)
          Deprecated. create a factory from a parsed persistence.xml Especially the scanning of classes and additional jars is done already at this point.
 Ejb3Configuration configure(PersistenceUnitInfo info, Map integration)
          Deprecated. Process configuration from a PersistenceUnitInfo object; typically called by the container via PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map).
 Ejb3Configuration configure(String resource)
          Deprecated.  
 Ejb3Configuration configure(String persistenceUnitName, Map integration)
          Deprecated. Build the configuration from an entity manager name and given the appropriate extra properties.
 EntityManagerFactory createEntityManagerFactory()
          Deprecated.  
 EntityManagerFactory createEntityManagerFactory(Map workingVars)
          Deprecated. use the Java Persistence API
 PersistentClass getClassMapping(String persistentClass)
          Deprecated.  
 Iterator getClassMappings()
          Deprecated.  
 Collection getCollectionMapping(String role)
          Deprecated.  
 Map getFilterDefinitions()
          Deprecated.  
 Configuration getHibernateConfiguration()
          Deprecated. This API is intended to give a read-only configuration.
 Interceptor getInterceptor()
          Deprecated.  
 Map getNamedQueries()
          Deprecated.  
 NamingStrategy getNamingStrategy()
          Deprecated.  
 Properties getProperties()
          Deprecated.  
 Reference getReference()
          Deprecated.  
 Iterator getTableMappings()
          Deprecated.  
 void setDataSource(DataSource ds)
          Deprecated. Used to inject a datasource object as the connection provider.
 void setEntityResolver(EntityResolver entityResolver)
          Deprecated.  
 Ejb3Configuration setInterceptor(Interceptor interceptor)
          Deprecated.  
 Ejb3Configuration setNamingStrategy(NamingStrategy namingStrategy)
          Deprecated.  
 Ejb3Configuration setProperties(Properties properties)
          Deprecated.  
 Ejb3Configuration setProperty(String key, String value)
          Deprecated.  
 Ejb3Configuration setSessionFactoryObserver(SessionFactoryObserver observer)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ejb3Configuration

public Ejb3Configuration()
Deprecated. 
Method Detail

setDataSource

public void setDataSource(DataSource ds)
Deprecated. 
Used to inject a datasource object as the connection provider. If used, be sure to not override the hibernate.connection.provider_class property


configure

public Ejb3Configuration configure(PersistenceMetadata metadata,
                                   Map overridesIn)
Deprecated. 
create a factory from a parsed persistence.xml Especially the scanning of classes and additional jars is done already at this point.

NOTE: public only for unit testing purposes; not a public API!

Parameters:
metadata - The information parsed from the persistence.xml
overridesIn - Any explicitly passed config settings
Returns:
this

configure

public Ejb3Configuration configure(String persistenceUnitName,
                                   Map integration)
Deprecated. 
Build the configuration from an entity manager name and given the appropriate extra properties. Those properties override the one get through the persistence.xml file. If the persistence unit name is not found or does not match the Persistence Provider, null is returned This method is used in a non managed environment

Parameters:
persistenceUnitName - persistence unit name
integration - properties passed to the persistence provider
Returns:
configured Ejb3Configuration or null if no persistence unit match
See Also:
HibernatePersistence.createEntityManagerFactory(String, java.util.Map)

configure

public Ejb3Configuration configure(PersistenceUnitInfo info,
                                   Map integration)
Deprecated. 
Process configuration from a PersistenceUnitInfo object; typically called by the container via PersistenceProvider.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map). In Hibernate EM, this correlates to HibernatePersistence.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

Parameters:
info - The persistence unit info passed in by the container (usually from processing a persistence.xml).
integration - The map of integration properties from the container to configure the provider.
Returns:
this
See Also:
HibernatePersistence.createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

setProperty

public Ejb3Configuration setProperty(String key,
                                     String value)
Deprecated. 

createEntityManagerFactory

@Deprecated
public EntityManagerFactory createEntityManagerFactory(Map workingVars)
Deprecated. use the Java Persistence API

create a factory from a list of properties and HibernatePersistence.CLASS_NAMES -> Collection (use to list the classes from config files HibernatePersistence.PACKAGE_NAMES -> Collection (use to list the mappings from config files HibernatePersistence.HBXML_FILES -> Collection (input streams of hbm files) HibernatePersistence.LOADED_CLASSES -> Collection (list of loaded classes)

Used by JBoss AS only


createEntityManagerFactory

@Deprecated
public EntityManagerFactory createEntityManagerFactory()
Deprecated. 

Process configuration and build an EntityManagerFactory when the configuration is ready


buildEntityManagerFactory

public EntityManagerFactory buildEntityManagerFactory()
Deprecated. 

buildEntityManagerFactory

public EntityManagerFactory buildEntityManagerFactory(BootstrapServiceRegistryBuilder builder)
Deprecated. 

getReference

public Reference getReference()
                       throws NamingException
Deprecated. 
Specified by:
getReference in interface Referenceable
Throws:
NamingException

configure

public Ejb3Configuration configure(Map configValues)
Deprecated. 

addProperties

public Ejb3Configuration addProperties(Properties props)
Deprecated. 

addAnnotatedClass

public Ejb3Configuration addAnnotatedClass(Class persistentClass)
                                    throws MappingException
Deprecated. 
Throws:
MappingException

configure

public Ejb3Configuration configure(String resource)
                            throws HibernateException
Deprecated. 
Throws:
HibernateException

addPackage

public Ejb3Configuration addPackage(String packageName)
                             throws MappingException
Deprecated. 
Throws:
MappingException

addFile

public Ejb3Configuration addFile(String xmlFile)
                          throws MappingException
Deprecated. 
Throws:
MappingException

addClass

public Ejb3Configuration addClass(Class persistentClass)
                           throws MappingException
Deprecated. 
Throws:
MappingException

addFile

public Ejb3Configuration addFile(File xmlFile)
                          throws MappingException
Deprecated. 
Throws:
MappingException

buildMappings

public void buildMappings()
Deprecated. 

getClassMappings

public Iterator getClassMappings()
Deprecated. 

getTableMappings

public Iterator getTableMappings()
Deprecated. 

getClassMapping

public PersistentClass getClassMapping(String persistentClass)
Deprecated. 

getCollectionMapping

public Collection getCollectionMapping(String role)
Deprecated. 

setEntityResolver

public void setEntityResolver(EntityResolver entityResolver)
Deprecated. 

getNamedQueries

public Map getNamedQueries()
Deprecated. 

getInterceptor

public Interceptor getInterceptor()
Deprecated. 

getProperties

public Properties getProperties()
Deprecated. 

setInterceptor

public Ejb3Configuration setInterceptor(Interceptor interceptor)
Deprecated. 

setProperties

public Ejb3Configuration setProperties(Properties properties)
Deprecated. 

getFilterDefinitions

public Map getFilterDefinitions()
Deprecated. 

addFilterDefinition

public void addFilterDefinition(FilterDefinition definition)
Deprecated. 

addAuxiliaryDatabaseObject

public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject object)
Deprecated. 

getNamingStrategy

public NamingStrategy getNamingStrategy()
Deprecated. 

setNamingStrategy

public Ejb3Configuration setNamingStrategy(NamingStrategy namingStrategy)
Deprecated. 

setSessionFactoryObserver

public Ejb3Configuration setSessionFactoryObserver(SessionFactoryObserver observer)
Deprecated. 

getHibernateConfiguration

public Configuration getHibernateConfiguration()
Deprecated. 
This API is intended to give a read-only configuration. It is sueful when working with SchemaExport or any Configuration based tool. DO NOT update configuration through it.


addInputStream

public Ejb3Configuration addInputStream(InputStream xmlInputStream)
                                 throws MappingException
Deprecated. 
Throws:
MappingException

addResource

public Ejb3Configuration addResource(String path)
                              throws MappingException
Deprecated. 
Throws:
MappingException

addResource

public Ejb3Configuration addResource(String path,
                                     ClassLoader classLoader)
                              throws MappingException
Deprecated. 
Throws:
MappingException


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.