org.hibernate.cfg
Class AnnotationConfiguration

java.lang.Object
  extended by org.hibernate.cfg.Configuration
      extended by org.hibernate.cfg.AnnotationConfiguration
All Implemented Interfaces:
Serializable

public class AnnotationConfiguration
extends org.hibernate.cfg.Configuration

Add JSR 175 configuration capability. For now, only programmatic configuration is available.

Author:
Emmanuel Bernard
See Also:
Serialized Form

Field Summary
static String ARTEFACT
           
static String DEFAULT_PRECEDENCE
           
 
Fields inherited from class org.hibernate.cfg.Configuration
auxiliaryDatabaseObjects, classes, collections, columnNameBindingPerTable, extendsQueue, filterDefinitions, imports, namedQueries, namedSqlQueries, namingStrategy, propertyReferences, secondPasses, settingsFactory, sqlResultSetMappings, tableNameBinding, tables, typeDefs
 
Constructor Summary
AnnotationConfiguration()
           
AnnotationConfiguration(org.hibernate.cfg.SettingsFactory sf)
           
 
Method Summary
protected  void add(org.dom4j.Document doc)
           
 AnnotationConfiguration addAnnotatedClass(Class persistentClass)
          Read a mapping from the class annotation metadata (JSR 175).
 AnnotationConfiguration addPackage(String packageName)
          Read package level metadata
 ExtendedMappings createExtendedMappings()
           
protected  List<XClass> orderAndFillHierarchy(List<XClass> original)
           
protected  void parseMappingElement(org.dom4j.Element subelement, String name)
           
protected  void reset()
           
protected  void secondPassCompile()
           
 void setCacheConcurrencyStrategy(String clazz, String concurrencyStrategy, String region, boolean cacheLazyProperty)
           
 void setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy, String region)
           
 void setPrecedence(String precedence)
           
 
Methods inherited from class org.hibernate.cfg.Configuration
addAuxiliaryDatabaseObject, addCacheableFile, addCacheableFile, addClass, addDirectory, addDocument, addFile, addFile, addFilterDefinition, addInputStream, addJar, addProperties, addResource, addResource, addURL, addXML, buildMapping, buildMappings, buildSessionFactory, buildSettings, buildSettings, configure, configure, configure, configure, configure, createMappings, doConfigure, doConfigure, findPossibleExtends, generateDropSchemaScript, generateSchemaCreationScript, generateSchemaUpdateScript, getClassMapping, getClassMappings, getCollectionMapping, getCollectionMappings, getConfigurationInputStream, getEntityResolver, getEventListeners, getFilterDefinitions, getImports, getInterceptor, getNamedQueries, getNamedSQLQueries, getNamingStrategy, getProperties, getProperty, getSqlResultSetMappings, getTableMappings, mergeProperties, secondPassCompileForeignKeys, setCacheConcurrencyStrategy, setCacheConcurrencyStrategy, setCollectionCacheConcurrencyStrategy, setEntityResolver, setInterceptor, setListener, setListeners, setListeners, setNamingStrategy, setProperties, setProperty, validateSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARTEFACT

public static final String ARTEFACT
See Also:
Constant Field Values

DEFAULT_PRECEDENCE

public static final String DEFAULT_PRECEDENCE
See Also:
Constant Field Values
Constructor Detail

AnnotationConfiguration

public AnnotationConfiguration()

AnnotationConfiguration

public AnnotationConfiguration(org.hibernate.cfg.SettingsFactory sf)
Method Detail

orderAndFillHierarchy

protected List<XClass> orderAndFillHierarchy(List<XClass> original)

addAnnotatedClass

public AnnotationConfiguration addAnnotatedClass(Class persistentClass)
                                          throws org.hibernate.MappingException
Read a mapping from the class annotation metadata (JSR 175).

Parameters:
persistentClass - the mapped class
Returns:
the configuration object
Throws:
org.hibernate.MappingException

addPackage

public AnnotationConfiguration addPackage(String packageName)
                                   throws org.hibernate.MappingException
Read package level metadata

Parameters:
packageName - java package name
Returns:
the configuration object
Throws:
org.hibernate.MappingException

createExtendedMappings

public ExtendedMappings createExtendedMappings()

setCacheConcurrencyStrategy

public void setCacheConcurrencyStrategy(String clazz,
                                        String concurrencyStrategy,
                                        String region,
                                        boolean cacheLazyProperty)
                                 throws org.hibernate.MappingException
Overrides:
setCacheConcurrencyStrategy in class org.hibernate.cfg.Configuration
Throws:
org.hibernate.MappingException

setCollectionCacheConcurrencyStrategy

public void setCollectionCacheConcurrencyStrategy(String collectionRole,
                                                  String concurrencyStrategy,
                                                  String region)
                                           throws org.hibernate.MappingException
Overrides:
setCollectionCacheConcurrencyStrategy in class org.hibernate.cfg.Configuration
Throws:
org.hibernate.MappingException

reset

protected void reset()
Overrides:
reset in class org.hibernate.cfg.Configuration

secondPassCompile

protected void secondPassCompile()
                          throws org.hibernate.MappingException
Overrides:
secondPassCompile in class org.hibernate.cfg.Configuration
Throws:
org.hibernate.MappingException

parseMappingElement

protected void parseMappingElement(org.dom4j.Element subelement,
                                   String name)
Overrides:
parseMappingElement in class org.hibernate.cfg.Configuration

add

protected void add(org.dom4j.Document doc)
            throws org.hibernate.MappingException
Overrides:
add in class org.hibernate.cfg.Configuration
Throws:
org.hibernate.MappingException

setPrecedence

public void setPrecedence(String precedence)