java.lang.Object | ||
↳ | org.hibernate.cfg.Configuration | |
↳ | org.hibernate.cfg.AnnotationConfiguration |
This class is deprecated.
All functionality has been moved to Configuration
Similar to the Configuration
object but handles EJB3 and Hibernate
specific annotations as a metadata facility.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnnotationConfiguration.ExtendedMappingsImpl |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.hibernate.cfg.Configuration
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.hibernate.cfg.Configuration
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Read metadata from the annotations associated with this class.
| |||||||||||
Add a cached mapping file.
| |||||||||||
Add a cacheable mapping file.
| |||||||||||
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.
| |||||||||||
Read all mapping documents from a directory tree.
| |||||||||||
Read mappings from a DOM Document
| |||||||||||
Read mappings from a particular XML file
| |||||||||||
Read mappings from a particular XML file
| |||||||||||
Read all mappings from a jar file
Assumes that any file named *.hbm.xml is a mapping document.
| |||||||||||
Read package-level metadata.
| |||||||||||
Add the given properties to ours.
| |||||||||||
Read mappings as a application resourceName (i.e.
| |||||||||||
Read mappings as a application resource (i.e.
| |||||||||||
Read mappings from a URL
| |||||||||||
Read mappings from a String
| |||||||||||
Use the mappings and properties specified in the given application file.
| |||||||||||
Use the mappings and properties specified in the given XML document.
| |||||||||||
Use the mappings and properties specified in the given document.
| |||||||||||
Use the mappings and properties specified in the given application resource.
| |||||||||||
Use the mappings and properties specified in an application resource named hibernate.cfg.xml.
| |||||||||||
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.
| |||||||||||
Set up a cache for an entity class
| |||||||||||
Set up a cache for an entity class, giving an explicit region name
| |||||||||||
Set up a cache for a collection role
| |||||||||||
Set the current
Interceptor | |||||||||||
Set a custom naming strategy
| |||||||||||
Defines a custom persister class provider.
| |||||||||||
Specify a completely new set of properties
| |||||||||||
Set a property value by name
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 | |||||||||||
Configure this configuration's state from the contents of the given input stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.hibernate.cfg.Configuration
| |||||||||||
From class
java.lang.Object
|
Read metadata from the annotations associated with this class.
annotatedClass | The class containing annotations |
---|
MappingException |
---|
Add a cached mapping file. A cached file is a serialized representation of the DOM structure of a particular mapping. It is saved from a previous call as a file with the name xmlFile + ".bin" where xmlFile is the name of the original mapping file.
If a cached xmlFile + ".bin" exists and is newer than xmlFile the ".bin" file will be read directly. Otherwise xmlFile is read and then serialized to xmlFile + ".bin" for use the next time.xmlFile | The cacheable mapping file to be added. |
---|
MappingException |
---|
Add a cacheable mapping file.
xmlFile | The name of the file to be added. This must be in a form
useable to simply construct a File instance. |
---|
MappingException |
---|
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.
persistentClass | The mapped class |
---|
MappingException |
---|
Read all mapping documents from a directory tree.
Assumes that any file named *.hbm.xml is a mapping document.dir | The directory |
---|
MappingException |
---|
Read mappings from a DOM Document
doc | The DOM document |
---|
MappingException |
---|
Read mappings from a particular XML file
xmlFile | a path to a file |
---|
MappingException |
---|
Read mappings from a particular XML file
xmlFile | a path to a file |
---|
MappingException |
---|
Read all mappings from a jar file
Assumes that any file named *.hbm.xml is a mapping document.jar | a jar file |
---|
MappingException |
---|
Read package-level metadata.
packageName | java package name |
---|
MappingException |
---|
Add the given properties to ours.
extraProperties | The properties to add. |
---|
Read mappings as a application resourceName (i.e. classpath lookup) trying different class loaders.
resourceName | The resource name |
---|
MappingException |
---|
Read mappings as a application resource (i.e. classpath lookup).
resourceName | The resource name |
---|---|
classLoader | The class loader to use. |
MappingException |
---|
Read mappings from a URL
url | The url for the mapping document to be read. |
---|
MappingException |
---|
Read mappings from a String
xml | an XML string |
---|
MappingException |
---|
Use the mappings and properties specified in the given application file. The format of the file is defined in hibernate-configuration-3.0.dtd.
configFile | File from which you wish to load the configuration |
---|
HibernateException |
---|
Use the mappings and properties specified in the given XML document. The format of the file is defined in hibernate-configuration-3.0.dtd.
document | an XML document from which you wish to load the configuration |
---|
HibernateException |
---|
Use the mappings and properties specified in the given document. The format of the document is defined in hibernate-configuration-3.0.dtd.
url | URL from which you wish to load the configuration |
---|
HibernateException |
---|
Use the mappings and properties specified in the given application resource. The format of the resource is defined in hibernate-configuration-3.0.dtd.
The resource is found viagetConfigurationInputStream(String)
resource | The resource to use |
---|
HibernateException |
---|
Use the mappings and properties specified in an application resource named hibernate.cfg.xml.
HibernateException |
---|
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.
properties | The properties to merge |
---|
Set up a cache for an entity class
clazz | The name of the entity to which we shoudl associate these cache settings |
---|---|
concurrencyStrategy | The cache strategy to use |
Set up a cache for an entity class, giving an explicit region name
clazz | The name of the entity to which we should associate these cache settings |
---|---|
concurrencyStrategy | The cache strategy to use |
region | The name of the cache region to use |
Set up a cache for a collection role
collectionRole | The name of the collection to which we should associate these cache settings |
---|---|
concurrencyStrategy | The cache strategy to use |
MappingException |
---|
Set the current Interceptor
interceptor | The Interceptor to use for the built
SessionFactory. |
---|
Set a custom naming strategy
namingStrategy | the NamingStrategy to set |
---|
Defines a custom persister class provider. The persister class is chosen according to the following rules in decreasing priority: - the persister class defined explicitly via annotation or XML - the persister class returned by the PersisterClassProvider implementation (if not null) - the default provider as chosen by Hibernate Core (best choice most of the time)
persisterClassProvider | implementation |
---|
Specify a completely new set of properties
properties | The new set of properties |
---|
Set a property value by name
propertyName | The name of the property to set |
---|---|
value | The new property value |
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
doc | The dom4j document |
---|
HibernateException |
---|
Configure this configuration's state from the contents of the given input stream. The expectation is that
the stream contents represent an XML document conforming to the Hibernate Configuration DTD. See
doConfigure(Document)
for further details.
stream | The input stream from which to read |
---|---|
resourceName | The name to use in warning/error messages |
HibernateException |
---|