Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate.ejb
Class Ejb3Configuration

    java.lang.Object
      org.hibernate.ejb.Ejb3Configuration

All Implemented Interfaces:
  java.io.Serializable, javax.naming.Referenceable

    public class Ejb3Configuration

extends java.lang.Object
implements java.io.Serializable, javax.naming.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

Author:
  Emmanuel Bernard
See Also:
  Serialized Form

Constructor Summary
`Ejb3Configuration()`

Method Summary
`Ejb3Configuration` | `addAnnotatedClass(java.lang.Class persistentClass)`
`void` | `addAuxiliaryDatabaseObject(org.hibernate.mapping.AuxiliaryDatabaseObject object)`
`Ejb3Configuration` | `addClass(java.lang.Class persistentClass)`
`Ejb3Configuration` | `addFile(java.io.File xmlFile)`
`Ejb3Configuration` | `addFile(java.lang.String xmlFile)`
`void` | `addFilterDefinition(org.hibernate.engine.FilterDefinition definition)`
`Ejb3Configuration` | `addInputStream(java.io.InputStream xmlInputStream)`
`Ejb3Configuration` | `addPackage(java.lang.String packageName)`
`Ejb3Configuration` | `addProperties(java.util.Properties props)`
`Ejb3Configuration` | `addResource(java.lang.String path)`
`Ejb3Configuration` | `addResource(java.lang.String path, java.lang.ClassLoader classLoader)`
`javax.persistence.EntityManagerFactory` | `buildEntityManagerFactory()`
`void` | `buildMappings()`
`org.hibernate.cfg.Settings` | `buildSettings()`
`Ejb3Configuration` | `configure(javax.persistence.spi.PersistenceUnitInfo info, java.util.Map integration)` Process configuration from a PersistenceUnitInfo object Typically called by the container
`Ejb3Configuration` | `configure(java.lang.String resource)`
`Ejb3Configuration` | `configure(java.lang.String persistenceUnitName, java.util.Map integration)` Build the configuration from an entity manager name and given the appropriate extra properties.
`javax.persistence.EntityManagerFactory` | `createEntityManagerFactory()` Deprecated.
`javax.persistence.EntityManagerFactory` | `createEntityManagerFactory(java.util.Map workingVars)` Deprecated. use the Java Persistence API
`org.hibernate.mapping.PersistentClass` | `getClassMapping(java.lang.String persistentClass)`
`java.util.Iterator` | `getClassMappings()`
`org.hibernate.mapping.Collection` | `getCollectionMapping(java.lang.String role)`
`org.hibernate.event.EventListeners` | `getEventListeners()`
`java.util.Map` | `getFilterDefinitions()`
`org.hibernate.cfg.AnnotationConfiguration` | `getHibernateConfiguration()` This API is intended to give a read-only configuration.
`org.hibernate.Interceptor` | `getInterceptor()`
`java.util.Map` | `getNamedQueries()`
`org.hibernate.cfg.NamingStrategy` | `getNamingStrategy()`
`java.util.Properties` | `getProperties()`
`javax.naming.Reference` | `getReference()`
`java.util.Iterator` | `getTableMappings()`
`void` | `setDataSource(javax.sql.DataSource ds)` Used to inject a datasource object as the connection provider.
`void` | `setEntityResolver(org.xml.sax.EntityResolver entityResolver)`
`Ejb3Configuration` | `setInterceptor(org.hibernate.Interceptor interceptor)`
`void` | `setListeners(java.lang.String type, java.lang.Object[] listeners)`
`void` | `setListeners(java.lang.String type, java.lang.String[] listenerClasses)`
`Ejb3Configuration` | `setNamingStrategy(org.hibernate.cfg.NamingStrategy namingStrategy)`
`Ejb3Configuration` | `setProperties(java.util.Properties properties)`
`Ejb3Configuration` | `setProperty(java.lang.String key, java.lang.String value)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Ejb3Configuration

    public Ejb3Configuration()

Method Detail

### setDataSource

    public void setDataSource(javax.sql.DataSource ds)

  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(java.lang.String persistenceUnitName,
                                       java.util.Map integration)

  Build the configuration from an entity manager name and given the appropriate extra properties. Those properties override the one get through the peristence.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

### configure

    public Ejb3Configuration configure(javax.persistence.spi.PersistenceUnitInfo info,
                                       java.util.Map integration)

  Process configuration from a PersistenceUnitInfo object Typically called by the container

### setProperty

    public Ejb3Configuration setProperty(java.lang.String key,
                                         java.lang.String value)

### createEntityManagerFactory

    public javax.persistence.EntityManagerFactory createEntityManagerFactory(java.util.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

    public javax.persistence.EntityManagerFactory createEntityManagerFactory()

  Deprecated.

  Process configuration and build an EntityManagerFactory when the configuration is ready

### buildEntityManagerFactory

    public javax.persistence.EntityManagerFactory buildEntityManagerFactory()

### getReference

    public javax.naming.Reference getReference()
                                        throws javax.naming.NamingException

  Specified by:
    `getReference` in interface `javax.naming.Referenceable`
  Throws:
    `javax.naming.NamingException`

### buildSettings

    public org.hibernate.cfg.Settings buildSettings()
                                             throws org.hibernate.HibernateException

  Throws:
    `org.hibernate.HibernateException`

### addProperties

    public Ejb3Configuration addProperties(java.util.Properties props)

### addAnnotatedClass

    public Ejb3Configuration addAnnotatedClass(java.lang.Class persistentClass)
                                        throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### configure

    public Ejb3Configuration configure(java.lang.String resource)
                                throws org.hibernate.HibernateException

  Throws:
    `org.hibernate.HibernateException`

### addPackage

    public Ejb3Configuration addPackage(java.lang.String packageName)
                                 throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### addFile

    public Ejb3Configuration addFile(java.lang.String xmlFile)
                              throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### addClass

    public Ejb3Configuration addClass(java.lang.Class persistentClass)
                               throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### addFile

    public Ejb3Configuration addFile(java.io.File xmlFile)
                              throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### buildMappings

    public void buildMappings()

### getClassMappings

    public java.util.Iterator getClassMappings()

### getEventListeners

    public org.hibernate.event.EventListeners getEventListeners()

### getTableMappings

    public java.util.Iterator getTableMappings()

### getClassMapping

    public org.hibernate.mapping.PersistentClass getClassMapping(java.lang.String persistentClass)

### getCollectionMapping

    public org.hibernate.mapping.Collection getCollectionMapping(java.lang.String role)

### setEntityResolver

    public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)

### getNamedQueries

    public java.util.Map getNamedQueries()

### getInterceptor

    public org.hibernate.Interceptor getInterceptor()

### getProperties

    public java.util.Properties getProperties()

### setInterceptor

    public Ejb3Configuration setInterceptor(org.hibernate.Interceptor interceptor)

### setProperties

    public Ejb3Configuration setProperties(java.util.Properties properties)

### getFilterDefinitions

    public java.util.Map getFilterDefinitions()

### addFilterDefinition

    public void addFilterDefinition(org.hibernate.engine.FilterDefinition definition)

### addAuxiliaryDatabaseObject

    public void addAuxiliaryDatabaseObject(org.hibernate.mapping.AuxiliaryDatabaseObject object)

### getNamingStrategy

    public org.hibernate.cfg.NamingStrategy getNamingStrategy()

### setNamingStrategy

    public Ejb3Configuration setNamingStrategy(org.hibernate.cfg.NamingStrategy namingStrategy)

### setListeners

    public void setListeners(java.lang.String type,
                             java.lang.String[] listenerClasses)

### setListeners

    public void setListeners(java.lang.String type,
                             java.lang.Object[] listeners)

### getHibernateConfiguration

    public org.hibernate.cfg.AnnotationConfiguration getHibernateConfiguration()

  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(java.io.InputStream xmlInputStream)
                                     throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### addResource

    public Ejb3Configuration addResource(java.lang.String path)
                                  throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

### addResource

    public Ejb3Configuration addResource(java.lang.String path,
                                         java.lang.ClassLoader classLoader)
                                  throws org.hibernate.MappingException

  Throws:
    `org.hibernate.MappingException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD