Configuration
@Deprecated public class AnnotationConfiguration extends Configuration
Configuration
object but handles EJB3 and Hibernate
specific annotations as a metadata facility.Modifier and Type | Class and Description |
---|---|
protected class |
AnnotationConfiguration.ExtendedMappingsImpl
Deprecated.
|
Configuration.MappingsImpl, Configuration.MetadataSourceQueue
ARTEFACT_PROCESSING_ORDER, auxiliaryDatabaseObjects, classes, collections, columnNameBindingPerTable, DEFAULT_ARTEFACT_PROCESSING_ORDER, DEFAULT_CACHE_CONCURRENCY_STRATEGY, extendsQueue, fetchProfiles, filterDefinitions, imports, metadataSourceQueue, namedQueries, namedSqlQueries, namingStrategy, propertyReferences, secondPasses, settingsFactory, sqlFunctions, sqlResultSetMappings, tableNameBinding, tables, typeDefs, USE_NEW_ID_GENERATOR_MAPPINGS, xmlHelper
Constructor and Description |
---|
AnnotationConfiguration()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
AnnotationConfiguration |
addAnnotatedClass(java.lang.Class annotatedClass)
Deprecated.
Read metadata from the annotations associated with this class.
|
AnnotationConfiguration |
addCacheableFile(java.io.File xmlFile)
Deprecated.
Add a cached mapping file.
|
AnnotationConfiguration |
addCacheableFile(java.lang.String xmlFile)
Deprecated.
Add a cacheable mapping file.
|
AnnotationConfiguration |
addClass(java.lang.Class persistentClass)
Deprecated.
Read a mapping as an application resource using the convention that a class
named foo.bar.Foo is mapped by a file foo/bar/Foo.hbm.xml
which can be resolved as a classpath resource.
|
AnnotationConfiguration |
addDirectory(java.io.File dir)
Deprecated.
Read all mapping documents from a directory tree.
|
AnnotationConfiguration |
addDocument(org.w3c.dom.Document doc)
Deprecated.
Read mappings from a DOM Document
|
AnnotationConfiguration |
addFile(java.io.File xmlFile)
Deprecated.
Read mappings from a particular XML file
|
AnnotationConfiguration |
addFile(java.lang.String xmlFile)
Deprecated.
Read mappings from a particular XML file
|
AnnotationConfiguration |
addJar(java.io.File jar)
Deprecated.
Read all mappings from a jar file
Assumes that any file named *.hbm.xml is a mapping document.
|
AnnotationConfiguration |
addPackage(java.lang.String packageName)
Deprecated.
Read package-level metadata.
|
AnnotationConfiguration |
addProperties(java.util.Properties extraProperties)
Deprecated.
Add the given properties to ours.
|
AnnotationConfiguration |
addResource(java.lang.String resourceName)
Deprecated.
Read mappings as a application resourceName (i.e.
|
AnnotationConfiguration |
addResource(java.lang.String resourceName,
java.lang.ClassLoader classLoader)
Deprecated.
Read mappings as a application resource (i.e.
|
AnnotationConfiguration |
addURL(java.net.URL url)
Deprecated.
Read mappings from a URL
|
AnnotationConfiguration |
addXML(java.lang.String xml)
Deprecated.
Read mappings from a String
|
AnnotationConfiguration |
configure()
Deprecated.
Use the mappings and properties specified in an application resource named hibernate.cfg.xml.
|
AnnotationConfiguration |
configure(org.w3c.dom.Document document)
Deprecated.
Use the mappings and properties specified in the given XML document.
|
AnnotationConfiguration |
configure(java.io.File configFile)
Deprecated.
Use the mappings and properties specified in the given application file.
|
AnnotationConfiguration |
configure(java.lang.String resource)
Deprecated.
Use the mappings and properties specified in the given application resource.
|
AnnotationConfiguration |
configure(java.net.URL url)
Deprecated.
Use the mappings and properties specified in the given document.
|
ExtendedMappings |
createExtendedMappings()
Deprecated.
|
protected AnnotationConfiguration |
doConfigure(org.dom4j.Document doc)
Deprecated.
Parse a dom4j document conforming to the Hibernate Configuration DTD (hibernate-configuration-3.0.dtd)
and use its information to configure this
Configuration 's state |
protected AnnotationConfiguration |
doConfigure(java.io.InputStream stream,
java.lang.String resourceName)
Deprecated.
Configure this configuration's state from the contents of the given input stream.
|
AnnotationConfiguration |
mergeProperties(java.util.Properties properties)
Deprecated.
Adds the incoming properties to the internal properties structure, as long as the internal structure does not
already contain an entry for the given key.
|
AnnotationConfiguration |
setCacheConcurrencyStrategy(java.lang.String clazz,
java.lang.String concurrencyStrategy)
Deprecated.
Set up a cache for an entity class
|
AnnotationConfiguration |
setCacheConcurrencyStrategy(java.lang.String clazz,
java.lang.String concurrencyStrategy,
java.lang.String region)
Deprecated.
Set up a cache for an entity class, giving an explicit region name
|
AnnotationConfiguration |
setCollectionCacheConcurrencyStrategy(java.lang.String collectionRole,
java.lang.String concurrencyStrategy)
Deprecated.
Set up a cache for a collection role
|
AnnotationConfiguration |
setInterceptor(Interceptor interceptor)
Deprecated.
Set the current
Interceptor |
AnnotationConfiguration |
setNamingStrategy(NamingStrategy namingStrategy)
Deprecated.
Set a custom naming strategy
|
AnnotationConfiguration |
setProperties(java.util.Properties properties)
Deprecated.
Specify a completely new set of properties
|
AnnotationConfiguration |
setProperty(java.lang.String propertyName,
java.lang.String value)
Deprecated.
Set a property value by name
|
add, addAuxiliaryDatabaseObject, addCacheableFileStrictly, addFetchProfile, addFilterDefinition, addInputStream, addSqlFunction, buildMapping, buildMappings, buildSessionFactory, buildSessionFactory, buildSettings, buildSettings, createMappings, findPossibleExtends, generateDropSchemaScript, generateSchemaCreationScript, generateSchemaUpdateScript, getClassMapping, getClassMappings, getCollectionMapping, getCollectionMappings, getConfigurationInputStream, getCurrentTenantIdentifierResolver, getEntityNotFoundDelegate, getEntityResolver, getEntityTuplizerFactory, getFilterDefinitions, getIdentifierGeneratorFactory, getImports, getInterceptor, getMappedSuperclassMappings, getNamedQueries, getNamedSQLQueries, getNamingStrategy, getProperties, getProperty, getReflectionManager, getSessionFactoryObserver, getSqlFunctions, getSqlResultSetMappings, getTableMappings, getTypeResolver, iterateFetchProfiles, registerTypeOverride, registerTypeOverride, registerTypeOverride, reset, secondPassCompile, secondPassCompileForeignKeys, setCacheConcurrencyStrategy, setCollectionCacheConcurrencyStrategy, setCurrentTenantIdentifierResolver, setEntityNotFoundDelegate, setEntityResolver, setPrecedence, setSessionFactoryObserver, validateSchema
public AnnotationConfiguration addAnnotatedClass(java.lang.Class annotatedClass) throws MappingException
addAnnotatedClass
in class Configuration
annotatedClass
- The class containing annotationsMappingException
public AnnotationConfiguration addPackage(java.lang.String packageName) throws MappingException
addPackage
in class Configuration
packageName
- java package nameMappingException
- in case there is an error in the mapping datapublic ExtendedMappings createExtendedMappings()
public AnnotationConfiguration addFile(java.lang.String xmlFile) throws MappingException
Configuration
addFile
in class Configuration
xmlFile
- a path to a fileMappingException
- Indicates inability to locate or parse
the specified mapping file.Configuration.addFile(java.io.File)
public AnnotationConfiguration addFile(java.io.File xmlFile) throws MappingException
Configuration
addFile
in class Configuration
xmlFile
- a path to a fileMappingException
- Indicates inability to locate the specified mapping file. Historically this could
have indicated a problem parsing the XML document, but that is now delayed until after Configuration.buildMappings()
public AnnotationConfiguration addCacheableFile(java.io.File xmlFile) throws MappingException
Configuration
addCacheableFile
in class Configuration
xmlFile
- The cacheable mapping file to be added.MappingException
- Indicates problems reading the cached file or processing
the non-cached file.public AnnotationConfiguration addCacheableFile(java.lang.String xmlFile) throws MappingException
Configuration
addCacheableFile
in class Configuration
xmlFile
- The name of the file to be added. This must be in a form
useable to simply construct a File
instance.MappingException
- Indicates problems reading the cached file or processing
the non-cached file.Configuration.addCacheableFile(java.io.File)
public AnnotationConfiguration addXML(java.lang.String xml) throws MappingException
Configuration
addXML
in class Configuration
xml
- an XML stringMappingException
- Indicates problems parsing the
given XML stringpublic AnnotationConfiguration addURL(java.net.URL url) throws MappingException
Configuration
addURL
in class Configuration
url
- The url for the mapping document to be read.MappingException
- Indicates problems reading the URL or processing
the mapping document.public AnnotationConfiguration addResource(java.lang.String resourceName, java.lang.ClassLoader classLoader) throws MappingException
Configuration
addResource
in class Configuration
resourceName
- The resource nameclassLoader
- The class loader to use.MappingException
- Indicates problems locating the resource or
processing the contained mapping document.public AnnotationConfiguration addDocument(org.w3c.dom.Document doc) throws MappingException
Configuration
addDocument
in class Configuration
doc
- The DOM documentMappingException
- Indicates problems reading the DOM or processing
the mapping document.public AnnotationConfiguration addResource(java.lang.String resourceName) throws MappingException
Configuration
addResource
in class Configuration
resourceName
- The resource nameMappingException
- Indicates problems locating the resource or
processing the contained mapping document.public AnnotationConfiguration addClass(java.lang.Class persistentClass) throws MappingException
Configuration
addClass
in class Configuration
persistentClass
- The mapped classMappingException
- Indicates problems locating the resource or
processing the contained mapping document.public AnnotationConfiguration addJar(java.io.File jar) throws MappingException
Configuration
addJar
in class Configuration
jar
- a jar fileMappingException
- Indicates problems reading the jar file or
processing the contained mapping documents.public AnnotationConfiguration addDirectory(java.io.File dir) throws MappingException
Configuration
addDirectory
in class Configuration
dir
- The directoryMappingException
- Indicates problems reading the jar file or
processing the contained mapping documents.public AnnotationConfiguration setInterceptor(Interceptor interceptor)
Configuration
Interceptor
setInterceptor
in class Configuration
interceptor
- The Interceptor
to use for the built
SessionFactory
.public AnnotationConfiguration setProperties(java.util.Properties properties)
Configuration
setProperties
in class Configuration
properties
- The new set of propertiespublic AnnotationConfiguration addProperties(java.util.Properties extraProperties)
Configuration
addProperties
in class Configuration
extraProperties
- The properties to add.public AnnotationConfiguration mergeProperties(java.util.Properties properties)
Configuration
mergeProperties
in class Configuration
properties
- The properties to mergepublic AnnotationConfiguration setProperty(java.lang.String propertyName, java.lang.String value)
Configuration
setProperty
in class Configuration
propertyName
- The name of the property to setvalue
- The new property valuepublic AnnotationConfiguration configure() throws HibernateException
Configuration
configure
in class Configuration
HibernateException
- Generally indicates we cannot find hibernate.cfg.xmlConfiguration.configure(String)
public AnnotationConfiguration configure(java.lang.String resource) throws HibernateException
Configuration
Configuration.getConfigurationInputStream(java.lang.String)
configure
in class Configuration
resource
- The resource to useHibernateException
- Generally indicates we cannot find the named resourceConfiguration.doConfigure(java.io.InputStream, String)
public AnnotationConfiguration configure(java.net.URL url) throws HibernateException
Configuration
configure
in class Configuration
url
- URL from which you wish to load the configurationHibernateException
- Generally indicates a problem access the urlConfiguration.doConfigure(java.io.InputStream, String)
public AnnotationConfiguration configure(java.io.File configFile) throws HibernateException
Configuration
configure
in class Configuration
configFile
- File from which you wish to load the configurationHibernateException
- Generally indicates a problem access the fileConfiguration.doConfigure(java.io.InputStream, String)
protected AnnotationConfiguration doConfigure(java.io.InputStream stream, java.lang.String resourceName) throws HibernateException
Configuration
Configuration.doConfigure(Document)
for further details.doConfigure
in class Configuration
stream
- The input stream from which to readresourceName
- The name to use in warning/error messagesHibernateException
- Indicates a problem reading the stream contents.public AnnotationConfiguration configure(org.w3c.dom.Document document) throws HibernateException
Configuration
configure
in class Configuration
document
- an XML document from which you wish to load the configurationHibernateException
- if there is problem in accessing the file.protected AnnotationConfiguration doConfigure(org.dom4j.Document doc) throws HibernateException
Configuration
Configuration
's statedoConfigure
in class Configuration
doc
- The dom4j documentHibernateException
- Indicates a problem performing the configuration taskpublic AnnotationConfiguration setCacheConcurrencyStrategy(java.lang.String clazz, java.lang.String concurrencyStrategy)
Configuration
setCacheConcurrencyStrategy
in class Configuration
clazz
- The name of the entity to which we shoudl associate these cache settingsconcurrencyStrategy
- The cache strategy to usepublic AnnotationConfiguration setCacheConcurrencyStrategy(java.lang.String clazz, java.lang.String concurrencyStrategy, java.lang.String region)
Configuration
setCacheConcurrencyStrategy
in class Configuration
clazz
- The name of the entity to which we should associate these cache settingsconcurrencyStrategy
- The cache strategy to useregion
- The name of the cache region to usepublic AnnotationConfiguration setCollectionCacheConcurrencyStrategy(java.lang.String collectionRole, java.lang.String concurrencyStrategy) throws MappingException
Configuration
setCollectionCacheConcurrencyStrategy
in class Configuration
collectionRole
- The name of the collection to which we should associate these cache settingsconcurrencyStrategy
- The cache strategy to useMappingException
public AnnotationConfiguration setNamingStrategy(NamingStrategy namingStrategy)
Configuration
setNamingStrategy
in class Configuration
namingStrategy
- the NamingStrategy to setCopyright © 2001-2012 Red Hat, Inc. All Rights Reserved.