|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.cfg.Configuration
org.hibernate.cfg.AnnotationConfiguration
Configuration
@Deprecated public class AnnotationConfiguration
Similar to the Configuration object but handles EJB3 and Hibernate
specific annotations as a metadata facility.
| Nested Class Summary | |
|---|---|
protected class |
AnnotationConfiguration.ExtendedMappingsImpl
Deprecated. |
| Nested classes/interfaces inherited from class org.hibernate.cfg.Configuration |
|---|
Configuration.MappingsImpl, Configuration.MetadataSourceQueue |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
AnnotationConfiguration()
Deprecated. |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotationConfiguration()
| Method Detail |
|---|
public AnnotationConfiguration addAnnotatedClass(Class annotatedClass)
throws MappingException
addAnnotatedClass in class ConfigurationannotatedClass - The class containing annotations
MappingException
public AnnotationConfiguration addPackage(String packageName)
throws MappingException
addPackage in class ConfigurationpackageName - java package name
MappingException - in case there is an error in the mapping datapublic ExtendedMappings createExtendedMappings()
public AnnotationConfiguration addFile(String xmlFile)
throws MappingException
Configuration
addFile in class ConfigurationxmlFile - a path to a file
MappingException - 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 ConfigurationxmlFile - a path to a file
MappingException - 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 ConfigurationxmlFile - 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 ConfigurationxmlFile - 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 Configurationxml - an XML string
MappingException - Indicates problems parsing the
given XML string
public AnnotationConfiguration addURL(URL url)
throws MappingException
Configuration
addURL in class Configurationurl - 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 ConfigurationresourceName - 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 Configurationdoc - The DOM document
MappingException - Indicates problems reading the DOM or processing
the mapping document.
public AnnotationConfiguration addResource(String resourceName)
throws MappingException
Configuration
addResource in class ConfigurationresourceName - The resource name
MappingException - Indicates problems locating the resource or
processing the contained mapping document.
public AnnotationConfiguration addClass(Class persistentClass)
throws MappingException
Configuration
addClass in class ConfigurationpersistentClass - The mapped class
MappingException - Indicates problems locating the resource or
processing the contained mapping document.
public AnnotationConfiguration addJar(File jar)
throws MappingException
Configuration
addJar in class Configurationjar - a jar file
MappingException - Indicates problems reading the jar file or
processing the contained mapping documents.
public AnnotationConfiguration addDirectory(File dir)
throws MappingException
Configuration
addDirectory in class Configurationdir - The directory
MappingException - Indicates problems reading the jar file or
processing the contained mapping documents.public AnnotationConfiguration setInterceptor(Interceptor interceptor)
ConfigurationInterceptor
setInterceptor in class Configurationinterceptor - The Interceptor to use for the built
SessionFactory.
public AnnotationConfiguration setProperties(Properties properties)
Configuration
setProperties in class Configurationproperties - The new set of properties
public AnnotationConfiguration addProperties(Properties extraProperties)
Configuration
addProperties in class ConfigurationextraProperties - The properties to add.
public AnnotationConfiguration mergeProperties(Properties properties)
Configuration
mergeProperties in class Configurationproperties - The properties to merge
public AnnotationConfiguration setProperty(String propertyName,
String value)
Configuration
setProperty in class ConfigurationpropertyName - The name of the property to setvalue - The new property value
public AnnotationConfiguration configure()
throws HibernateException
Configuration
configure in class ConfigurationHibernateException - Generally indicates we cannot find hibernate.cfg.xmlConfiguration.configure(String)
public AnnotationConfiguration configure(String resource)
throws HibernateException
ConfigurationConfiguration.getConfigurationInputStream(java.lang.String)
configure in class Configurationresource - The resource to use
HibernateException - Generally indicates we cannot find the named resourceConfiguration.doConfigure(java.io.InputStream, String)
public AnnotationConfiguration configure(URL url)
throws HibernateException
Configuration
configure in class Configurationurl - URL from which you wish to load the configuration
HibernateException - Generally indicates a problem access the urlConfiguration.doConfigure(java.io.InputStream, String)
public AnnotationConfiguration configure(File configFile)
throws HibernateException
Configuration
configure in class ConfigurationconfigFile - File from which you wish to load the configuration
HibernateException - Generally indicates a problem access the fileConfiguration.doConfigure(java.io.InputStream, String)
protected AnnotationConfiguration doConfigure(InputStream stream,
String resourceName)
throws HibernateException
ConfigurationConfiguration.doConfigure(Document) for further details.
doConfigure in class Configurationstream - The input stream from which to readresourceName - The name to use in warning/error messages
HibernateException - Indicates a problem reading the stream contents.
public AnnotationConfiguration configure(Document document)
throws HibernateException
Configuration
configure in class Configurationdocument - an XML document from which you wish to load the configuration
HibernateException - if there is problem in accessing the file.
protected AnnotationConfiguration doConfigure(org.dom4j.Document doc)
throws HibernateException
ConfigurationConfiguration's state
doConfigure in class Configurationdoc - The dom4j document
HibernateException - Indicates a problem performing the configuration task
public AnnotationConfiguration setCacheConcurrencyStrategy(String clazz,
String concurrencyStrategy)
Configuration
setCacheConcurrencyStrategy in class Configurationclazz - The name of the entity to which we shoudl associate these cache settingsconcurrencyStrategy - The cache strategy to use
public AnnotationConfiguration setCacheConcurrencyStrategy(String clazz,
String concurrencyStrategy,
String region)
Configuration
setCacheConcurrencyStrategy in class Configurationclazz - 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 use
public AnnotationConfiguration setCollectionCacheConcurrencyStrategy(String collectionRole,
String concurrencyStrategy)
throws MappingException
Configuration
setCollectionCacheConcurrencyStrategy in class ConfigurationcollectionRole - The name of the collection to which we should associate these cache settingsconcurrencyStrategy - The cache strategy to use
MappingExceptionpublic AnnotationConfiguration setNamingStrategy(NamingStrategy namingStrategy)
ConfigurationLegacyNamingStrategyDelegator
will be constructed with the specified naming strategy.
setNamingStrategy in class ConfigurationnamingStrategy - the NamingStrategy to set; must be non-null.
LegacyNamingStrategyDelegator.LegacyNamingStrategyDelegator(NamingStrategy)public AnnotationConfiguration setNamingStrategyDelegator(NamingStrategyDelegator namingStrategyDelegator)
Configuration
setNamingStrategyDelegator in class ConfigurationnamingStrategyDelegator - the NamingStrategyDelegator to set;
must be non-null; if namingStrategyDelegator is an instance
of LegacyNamingStrategyDelegator, then
LegacyNamingStrategyDelegator.getNamingStrategy() must be non-null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||