|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.metamodel.MetadataSources
public class MetadataSources
| Constructor Summary | |
|---|---|
MetadataSources(ServiceRegistry serviceRegistry)
|
|
MetadataSources(ServiceRegistry serviceRegistry,
EntityResolver entityResolver,
NamingStrategy namingStrategy)
|
|
| Method Summary | |
|---|---|
MetadataSources |
addAnnotatedClass(Class annotatedClass)
Read metadata from the annotations attached to the given class. |
MetadataSources |
addCacheableFile(File file)
Add a cached mapping file. |
MetadataSources |
addCacheableFile(String path)
See addCacheableFile(java.io.File) for description |
MetadataSources |
addClass(Class entityClass)
Read a mapping as an application resource using the convention that a class named foo.bar.Foo is
mapped by a file named foo/bar/Foo.hbm.xml which can be resolved as a classpath resource. |
MetadataSources |
addDirectory(File dir)
Read all mapping documents from a directory tree. |
MetadataSources |
addDocument(Document document)
Read mappings from a DOM Document |
MetadataSources |
addFile(File file)
Read mappings from a particular XML file |
MetadataSources |
addFile(String path)
Read mappings from a particular XML file |
MetadataSources |
addInputStream(InputStream xmlInputStream)
Read metadata from an InputStream. |
MetadataSources |
addJar(File jar)
Read all mappings from a jar file. |
MetadataSources |
addPackage(String packageName)
Read package-level metadata. |
MetadataSources |
addResource(String name)
Read mappings as a application resourceName (i.e. |
MetadataSources |
addURL(URL url)
Read mappings from a URL |
Metadata |
buildMetadata()
|
Iterable<Class<?>> |
getAnnotatedClasses()
|
Iterable<String> |
getAnnotatedPackages()
|
List<JaxbRoot> |
getJaxbRootList()
|
MetadataBuilder |
getMetadataBuilder()
|
NamingStrategy |
getNamingStrategy()
|
ServiceRegistry |
getServiceRegistry()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MetadataSources(ServiceRegistry serviceRegistry)
public MetadataSources(ServiceRegistry serviceRegistry,
EntityResolver entityResolver,
NamingStrategy namingStrategy)
| Method Detail |
|---|
public List<JaxbRoot> getJaxbRootList()
public Iterable<String> getAnnotatedPackages()
public Iterable<Class<?>> getAnnotatedClasses()
public ServiceRegistry getServiceRegistry()
public NamingStrategy getNamingStrategy()
public MetadataBuilder getMetadataBuilder()
public Metadata buildMetadata()
public MetadataSources addAnnotatedClass(Class annotatedClass)
annotatedClass - The class containing annotations
public MetadataSources addPackage(String packageName)
packageName - java package name without trailing '.', cannot be null
public MetadataSources addResource(String name)
name - The resource name
public MetadataSources addClass(Class entityClass)
foo.bar.Foo is
mapped by a file named foo/bar/Foo.hbm.xml which can be resolved as a classpath resource.
entityClass - The mapped class. Cannot be null null.
public MetadataSources addFile(String path)
path - The path to a file. Expected to be resolvable by File.File(String)
addFile(java.io.File)public MetadataSources addFile(File file)
file - The reference to the XML file
public MetadataSources addCacheableFile(String path)
addCacheableFile(java.io.File) for description
path - The path to a file. Expected to be resolvable by File.File(String)
addCacheableFile(java.io.File)public MetadataSources addCacheableFile(File file)
{xmlFile}.bin
where {xmlFile} is the name of the original mapping file.
If a cached {xmlFile}.bin exists and is newer than {xmlFile}, the {xmlFile}.bin
file will be read directly. Otherwise {xmlFile} is read and then serialized to {xmlFile}.bin for
use the next time.
file - The cacheable mapping file to be added, {xmlFile} in above discussion.
public MetadataSources addInputStream(InputStream xmlInputStream)
InputStream.
xmlInputStream - The input stream containing a DOM.
public MetadataSources addURL(URL url)
URL
url - The url for the mapping document to be read.
public MetadataSources addDocument(Document document)
Document
document - The DOM document
public MetadataSources addJar(File jar)
jar - a jar file
public MetadataSources addDirectory(File dir)
dir - The directory
MappingException - Indicates problems reading the jar file or
processing the contained mapping documents.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||