|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. |
|
AnnotationConfiguration(SettingsFactory sf)
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 a custom naming strategy |
AnnotationConfiguration |
setPersisterClassProvider(PersisterClassProvider persisterClassProvider)
Deprecated. Defines a custom persister class provider. |
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()
public AnnotationConfiguration(SettingsFactory sf)
Method Detail |
---|
public AnnotationConfiguration addAnnotatedClass(Class annotatedClass) throws MappingException
addAnnotatedClass
in class Configuration
annotatedClass
- The class containing annotations
MappingException
public AnnotationConfiguration addPackage(String packageName) throws MappingException
addPackage
in class Configuration
packageName
- 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 Configuration
xmlFile
- 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 Configuration
xmlFile
- 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 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 string
MappingException
- 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 document
MappingException
- 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 name
MappingException
- 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 class
MappingException
- 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 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 Configuration
dir
- The directory
MappingException
- 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 properties
public 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 merge
public AnnotationConfiguration setProperty(String propertyName, String value)
Configuration
setProperty
in class Configuration
propertyName
- The name of the property to setvalue
- The new property value
public 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 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 Configuration
url
- 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 Configuration
configFile
- 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
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 messages
HibernateException
- 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 configuration
HibernateException
- if there is problem in accessing the file.protected AnnotationConfiguration doConfigure(org.dom4j.Document doc) throws HibernateException
Configuration
Configuration
's state
doConfigure
in class Configuration
doc
- The dom4j document
HibernateException
- 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 use
public 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 use
public 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 use
MappingException
public AnnotationConfiguration setNamingStrategy(NamingStrategy namingStrategy)
Configuration
setNamingStrategy
in class Configuration
namingStrategy
- the NamingStrategy to set
public AnnotationConfiguration setPersisterClassProvider(PersisterClassProvider persisterClassProvider)
Configuration
setPersisterClassProvider
in class Configuration
persisterClassProvider
- implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |