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, 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(Class annotatedClass)
Deprecated.
Read metadata from the annotations associated with this class.
|
AnnotationConfiguration |
addCacheableFile(File xmlFile)
Deprecated.
Add a cached mapping file.
|
AnnotationConfiguration |
addCacheableFile(String xmlFile)
Deprecated.
Add a cacheable mapping file.
|
AnnotationConfiguration |
addClass(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(File dir)
Deprecated.
Read all mapping documents from a directory tree.
|
AnnotationConfiguration |
addDocument(Document doc)
Deprecated.
Read mappings from a DOM Document
|
AnnotationConfiguration |
addFile(File xmlFile)
Deprecated.
Read mappings from a particular XML file
|
AnnotationConfiguration |
addFile(String xmlFile)
Deprecated.
Read mappings from a particular XML file
|
AnnotationConfiguration |
addJar(File jar)
Deprecated.
Read all mappings from a jar file
Assumes that any file named *.hbm.xml is a mapping document.
|
AnnotationConfiguration |
addPackage(String packageName)
Deprecated.
Read package-level metadata.
|
AnnotationConfiguration |
addProperties(Properties extraProperties)
Deprecated.
Add the given properties to ours.
|
AnnotationConfiguration |
addResource(String resourceName)
Deprecated.
Read mappings as a application resourceName (i.e.
|
AnnotationConfiguration |
addResource(String resourceName,
ClassLoader classLoader)
Deprecated.
Read mappings as a application resource (i.e.
|
AnnotationConfiguration |
addURL(URL url)
Deprecated.
Read mappings from a URL
|
AnnotationConfiguration |
addXML(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(Document document)
Deprecated.
Use the mappings and properties specified in the given XML document.
|
AnnotationConfiguration |
configure(File configFile)
Deprecated.
Use the mappings and properties specified in the given application file.
|
AnnotationConfiguration |
configure(String resource)
Deprecated.
Use the mappings and properties specified in the given application resource.
|
AnnotationConfiguration |
configure(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(InputStream stream,
String resourceName)
Deprecated.
Configure this configuration's state from the contents of the given input stream.
|
AnnotationConfiguration |
mergeProperties(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(String clazz,
String concurrencyStrategy)
Deprecated.
Set up a cache for an entity class
|
AnnotationConfiguration |
setCacheConcurrencyStrategy(String clazz,
String concurrencyStrategy,
String region)
Deprecated.
Set up a cache for an entity class, giving an explicit region name
|
AnnotationConfiguration |
setCollectionCacheConcurrencyStrategy(String collectionRole,
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 the current naming strategy.
|
AnnotationConfiguration |
setNamingStrategyDelegator(NamingStrategyDelegator namingStrategyDelegator)
Deprecated.
Set a current naming strategy delegator.
|
AnnotationConfiguration |
setProperties(Properties properties)
Deprecated.
Specify a completely new set of properties
|
AnnotationConfiguration |
setProperty(String propertyName,
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, generateSchemaUpdateScriptList, getClassMapping, getClassMappings, getCollectionMapping, getCollectionMappings, getConfigurationInputStream, getCurrentTenantIdentifierResolver, getEntityNotFoundDelegate, getEntityResolver, getEntityTuplizerFactory, getFilterDefinitions, getIdentifierGeneratorFactory, getImports, getInterceptor, getMappedSuperclassMappings, getNamedQueries, getNamedSQLQueries, getNamingStrategy, getNamingStrategyDelegator, getProperties, getProperty, getReflectionManager, getSessionFactoryObserver, getSqlFunctions, getSqlResultSetMappings, getTableMappings, getTypeResolver, iterateFetchProfiles, registerTypeContributor, registerTypeOverride, registerTypeOverride, registerTypeOverride, reset, secondPassCompile, secondPassCompileForeignKeys, setCacheConcurrencyStrategy, setCollectionCacheConcurrencyStrategy, setCurrentTenantIdentifierResolver, setEntityNotFoundDelegate, setEntityResolver, setPrecedence, setSessionFactoryObserver, validateSchema
public AnnotationConfiguration addAnnotatedClass(Class annotatedClass) throws MappingException
addAnnotatedClass
in class Configuration
annotatedClass
- The class containing annotationsMappingException
public AnnotationConfiguration addPackage(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(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(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(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(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(String xml) throws MappingException
Configuration
addXML
in class Configuration
xml
- an XML stringMappingException
- Indicates problems parsing the
given XML stringpublic AnnotationConfiguration addURL(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(String resourceName, 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(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(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(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(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(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(Properties properties)
Configuration
setProperties
in class Configuration
properties
- The new set of propertiespublic AnnotationConfiguration addProperties(Properties extraProperties)
Configuration
addProperties
in class Configuration
extraProperties
- The properties to add.public AnnotationConfiguration mergeProperties(Properties properties)
Configuration
mergeProperties
in class Configuration
properties
- The properties to mergepublic AnnotationConfiguration setProperty(String propertyName, 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(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(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(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(InputStream stream, 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(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(String clazz, 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(String clazz, String concurrencyStrategy, 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(String collectionRole, 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
LegacyNamingStrategyDelegator
will be constructed with the specified naming strategy.setNamingStrategy
in class Configuration
namingStrategy
- the NamingStrategy
to set; must be non-null.LegacyNamingStrategyDelegator.LegacyNamingStrategyDelegator(NamingStrategy)
public AnnotationConfiguration setNamingStrategyDelegator(NamingStrategyDelegator namingStrategyDelegator)
Configuration
setNamingStrategyDelegator
in class Configuration
namingStrategyDelegator
- the NamingStrategyDelegator
to set;
must be non-null; if namingStrategyDelegator
is an instance
of LegacyNamingStrategyDelegator
, then
LegacyNamingStrategyDelegator.getNamingStrategy()
must be non-null.Copyright © 2018 JBoss by Red Hat. All rights reserved.