Note that XML mappings may be expressed using the JPA orm.xml
format, or in Hibernate's legacy .hbm.xml format.
An instance of MetadataSources may be obtained simply by
instantiation, using new MetadataSources().
The client must register sources and then call buildMetadata(),
or use getMetadataBuilder() to customize how the sources are
processed (by registering naming strategies, etc).
As an alternative to working directly with MetadataSources, and
Metadata, a program may use org..
| Modifier and Type | Field and Description |
|---|---|
| private LinkedHashSet | |
| private LinkedHashSet | |
| private LinkedHashSet | |
| private final ClassLoaderService | |
| private Map | |
| private static final CoreMessageLogger | |
| private final ServiceRegistry | |
| private List | |
| private XmlMappingBinderAccess |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MetadataSources(ServiceRegistry
The service registry to use. serviceRegistry)Create a new instance using the given |
| public | MetadataSources(ServiceRegistry
The service registry to use. serviceRegistry, XmlMappingBinderAccess xmlMappingBinderAccess)Create a new instance using the given |
| Modifier and Type | Method and Description |
|---|---|
| public MetadataSources | Returns: this (for method chaining)The class containing annotations annotatedClass)Read metadata from the annotations attached to the given class. |
| public MetadataSources | |
| public MetadataSources | Returns: this (for method chaining)The name of a class containing annotations annotatedClassName)Read metadata from the annotations attached to the given class. |
| public MetadataSources | |
| public MetadataSources | Returns: this (for method chaining purposes)The path to a file path)Add a |
| public MetadataSources | Returns: this (for method chaining purposes)The path to a file path, File cacheDirectory)Add a |
| public MetadataSources | Returns: this (for method chaining purposes)The cacheable mapping file to be added, file){xmlFile} in above discussion.Add a cached mapping file. |
| public MetadataSources | Returns: this (for method chaining purposes)The cacheable mapping file to be added, file, File cacheDirectory){xmlFile} in above discussion.Add a cached mapping file. |
| public MetadataSources | Returns: The dom "deserialized" from the cached file.The xml file, not the bin! file)INTENDED FOR TESTSUITE USE ONLY! |
| public MetadataSources | Returns: The dom "deserialized" from the cached file.The xml file, not the bin! file, File cacheDir)INTENDED FOR TESTSUITE USE ONLY! |
| public MetadataSources | Returns: this (for method chaining purposes)The directory dir)Read all |
| public MetadataSources | |
| public MetadataSources | |
| public MetadataSources | Returns: this (for method chaining purposes)Access to an input stream containing a DOM. xmlInputStreamAccess)Read metadata from an |
| public MetadataSources | Returns: this (for method chaining purposes)The input stream containing a DOM. xmlInputStream)Read metadata from an |
| public MetadataSources | |
| public MetadataSources | Returns: this (for method chaining)java package name without trailing '.', cannot be packageName)nullRead package-level metadata. |
| public MetadataSources | Returns: this (for method chaining)Java Package reference packageRef)Read package-level metadata. |
| private void | |
| public MetadataSources | |
| public MetadataSources | Returns: this (for method chaining purposes)The resource name name)Read mappings as an application resourceName (i.e. classpath lookup). |
| public MetadataSources | |
| public MetadataSources | Returns: this (for method chaining purposes)The binding binding)Add XML mapping bindings created from an arbitrary source by the binder. |
| public Metadata | Returns: The built metadata.
Deprecated
as a consequence of
Shorthand form of calling Metadata being deprecated.
getMetadataBuilder() and using its
MetadataBuilder#build() method in cases where the application
wants to accept the defaults.
|
| public Metadata | buildMetadata(StandardServiceRegistry serviceRegistry)
Deprecated
as a consequence of
Metadata being deprecated.
|
| public Collection | |
| public Collection | |
| public Collection | |
| private MetadataBuilder | getCustomBuilderOrDefault(MetadataBuilderImpl defaultBuilder)
In case a custom |
| public Map | |
| public MetadataBuilder | Returns: The built metadata.Get a builder for metadata where non-default options can be specified. |
| public MetadataBuilder | Returns: The built metadata.Get a builder for metadata where non-default options can be specified. |
| public ServiceRegistry | |
| public List | |
| private List | |
| public XmlMappingBinderAccess | |
| protected static boolean |
| annotatedClasses | back to summary |
|---|---|
| private LinkedHashSet<Class<?>> annotatedClasses | |
| annotatedClassNames | back to summary |
|---|---|
| private LinkedHashSet<String> annotatedClassNames | |
| annotatedPackages | back to summary |
|---|---|
| private LinkedHashSet<String> annotatedPackages | |
| classLoaderService | back to summary |
|---|---|
| private final ClassLoaderService classLoaderService | |
| extraQueryImports | back to summary |
|---|---|
| private Map<String, Class<?>> extraQueryImports | |
| LOG | back to summary |
|---|---|
| private static final CoreMessageLogger LOG | |
| serviceRegistry | back to summary |
|---|---|
| private final ServiceRegistry serviceRegistry | |
| xmlBindings | back to summary |
|---|---|
| private List<Binding<BindableMappingDescriptor>> xmlBindings | |
| xmlMappingBinderAccess | back to summary |
|---|---|
| private XmlMappingBinderAccess xmlMappingBinderAccess | |
| MetadataSources | back to summary |
|---|---|
| public MetadataSources() Create a new instance, using a default | |
| MetadataSources | back to summary |
|---|---|
| public MetadataSources(ServiceRegistry serviceRegistry) Create a new instance using the given
| |
| MetadataSources | back to summary |
|---|---|
| public MetadataSources(ServiceRegistry serviceRegistry, XmlMappingBinderAccess xmlMappingBinderAccess) Create a new instance using the given
| |
| addAnnotatedClass | back to summary |
|---|---|
| public MetadataSources addAnnotatedClass(Class<?> annotatedClass) Read metadata from the annotations attached to the given class.
| |
| addAnnotatedClasses | back to summary |
|---|---|
| public MetadataSources addAnnotatedClasses(Class<?>... annotatedClasses) Vararg form of | |
| addAnnotatedClassName | back to summary |
|---|---|
| public MetadataSources addAnnotatedClassName(String annotatedClassName) Read metadata from the annotations attached to the given class. The
important distinction here is that the
| |
| addAnnotatedClassNames | back to summary |
|---|---|
| public MetadataSources addAnnotatedClassNames(String... annotatedClassNames) Vararg form of | |
| addCacheableFile | back to summary |
|---|---|
| public MetadataSources addCacheableFile(String path) Add a
The given path is resolved using
| |
| addCacheableFile | back to summary |
|---|---|
| public MetadataSources addCacheableFile(String path, File cacheDirectory) Add a
The given path is resolved using
| |
| addCacheableFile | back to summary |
|---|---|
| public MetadataSources addCacheableFile(File file) 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
If a cached
| |
| addCacheableFile | back to summary |
|---|---|
| public MetadataSources addCacheableFile(File file, File cacheDirectory) 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
If a cached
| |
| addCacheableFileStrictly | back to summary |
|---|---|
| public MetadataSources addCacheableFileStrictly(File file) throws SerializationException INTENDED FOR TESTSUITE USE ONLY!
Much like
| |
| addCacheableFileStrictly | back to summary |
|---|---|
| public MetadataSources addCacheableFileStrictly(File file, File cacheDir) throws SerializationException INTENDED FOR TESTSUITE USE ONLY!
Much like
| |
| addDirectory | back to summary |
|---|---|
| public MetadataSources addDirectory(File dir) Read all
Assumes that any file named
| |
| addFile | back to summary |
|---|---|
| public MetadataSources addFile(String path) Read mappings from a particular XML file.
The given path is resolved using
| |
| addFile | back to summary |
|---|---|
| public MetadataSources addFile(File file) Read mappings from a particular XML file.
| |
| addInputStream | back to summary |
|---|---|
| public MetadataSources addInputStream(InputStreamAccess xmlInputStreamAccess) Read metadata from an
| |
| addInputStream | back to summary |
|---|---|
| public MetadataSources addInputStream(InputStream xmlInputStream) Read metadata from an
| |
| addJar | back to summary |
|---|---|
| public MetadataSources addJar(File jar) Read all
Assumes that any file named
| |
| addPackage | back to summary |
|---|---|
| public MetadataSources addPackage(String packageName) Read package-level metadata.
| |
| addPackage | back to summary |
|---|---|
| public MetadataSources addPackage(Package packageRef) Read package-level metadata.
| |
| addPackageInternal | back to summary |
|---|---|
| private void addPackageInternal(String packageName) | |
| addQueryImport | back to summary |
|---|---|
| public MetadataSources addQueryImport(String importedName, Class<?> target) | |
| addResource | back to summary |
|---|---|
| public MetadataSources addResource(String name) Read mappings as an application resourceName (i.e. classpath lookup).
| |
| addURL | back to summary |
|---|---|
| public MetadataSources addURL(URL url) Read mappings from a
| |
| addXmlBinding | back to summary |
|---|---|
| public MetadataSources addXmlBinding(Binding<?> binding) Add XML mapping bindings created from an arbitrary source by the binder.
| |
| buildMetadata | back to summary |
|---|---|
| public Metadata buildMetadata()
Deprecated as a consequence of Shorthand form of calling
| |
| buildMetadata | back to summary |
|---|---|
| public Metadata buildMetadata(StandardServiceRegistry serviceRegistry)
Deprecated as a consequence of | |
| getAnnotatedClasses | back to summary |
|---|---|
| public Collection | |
| getAnnotatedClassNames | back to summary |
|---|---|
| public Collection | |
| getAnnotatedPackages | back to summary |
|---|---|
| public Collection | |
| getCustomBuilderOrDefault | back to summary |
|---|---|
| private MetadataBuilder getCustomBuilderOrDefault(MetadataBuilderImpl defaultBuilder) In case a custom | |
| getExtraQueryImports | back to summary |
|---|---|
| public Map | |
| getMetadataBuilder | back to summary |
|---|---|
| public MetadataBuilder getMetadataBuilder() Get a builder for metadata where non-default options can be specified.
| |
| getMetadataBuilder | back to summary |
|---|---|
| public MetadataBuilder getMetadataBuilder(StandardServiceRegistry serviceRegistry) Get a builder for metadata where non-default options can be specified.
| |
| getServiceRegistry | back to summary |
|---|---|
| public ServiceRegistry getServiceRegistry() | |
| getXmlBindings | back to summary |
|---|---|
| public List | |
| getXmlBindingsForWrite | back to summary |
|---|---|
| private List | |
| getXmlMappingBinderAccess | back to summary |
|---|---|
| public XmlMappingBinderAccess getXmlMappingBinderAccess() | |
| isExpectedServiceRegistryType | back to summary |
|---|---|
| protected static boolean isExpectedServiceRegistryType(ServiceRegistry serviceRegistry) | |