public class MetaDataPlusMappingFactory extends DelegatingMetaDataFactory
MetaDataFactory
instances -- one for
metadata, one for mappings -- into a single MetaDataFactory
facade.STORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSE
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
Constructor and Description |
---|
MetaDataPlusMappingFactory(MetaDataFactory meta,
MetaDataFactory map)
Constructor; supply delegates.
|
MetaDataPlusMappingFactory(MetaDataFactory meta,
MetaDataFactory map,
OpenJPAConfiguration conf)
Constructor, supply delegates and Configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addClassExtensionKeys(Collection exts)
Add any extension keys used by this instance to the given set.
|
void |
addFieldExtensionKeys(Collection exts)
Add any extension keys used by this instance to the given set.
|
void |
clear()
Clear any internal caches.
|
boolean |
drop(Class[] cls,
int mode,
ClassLoader envLoader)
Drop the metadata for the given classes in the given mode(s).
|
MetaDataFactory |
getInnermostMappingDelegate()
Innermost mapping delegate.
|
MetaDataFactory |
getMappingDelegate()
Mapping factory delegate.
|
Set |
getPersistentTypeNames(boolean classpath,
ClassLoader envLoader)
Return all persistent class names, using the metadata locations supplied
in configuration, optionally scanning the classpath.
|
void |
load(Class cls,
int mode,
ClassLoader envLoader)
Load metadata for the given class in the given mode(s).
|
void |
setRepository(MetaDataRepository repos)
Set the repository to load metadata into.
|
void |
setStoreDirectory(File dir)
Base directory for storing metadata.
|
void |
setStoreMode(int store)
Storage mode.
|
void |
setStrict(boolean strict)
If true, I/O's must exactly obey the mode directives given, and may
not load additional information.
|
boolean |
store(ClassMetaData[] metas,
QueryMetaData[] queries,
SequenceMetaData[] seqs,
int mode,
Map output)
Store the given metadata.
|
getDefaults, getDelegate, getInnermostDelegate, getManagedClass, getManagedClassName, getMetaModelClassName, getQueryScope, getResultSetMappingScope, isMetaClass, loadXMLMetaData, newClassArgParser
public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map)
public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map, OpenJPAConfiguration conf)
meta
- MetaFactory delegate, should not be null.map
- MappingFactory delegate, should not be null.conf
- Configuration in use. Used to determine whether delegates should use strict mode.public MetaDataFactory getMappingDelegate()
public MetaDataFactory getInnermostMappingDelegate()
public void setRepository(MetaDataRepository repos)
MetaDataFactory
setRepository
in interface MetaDataFactory
setRepository
in class DelegatingMetaDataFactory
public void setStoreDirectory(File dir)
MetaDataFactory
setStoreDirectory
in interface MetaDataFactory
setStoreDirectory
in class DelegatingMetaDataFactory
public void setStoreMode(int store)
MetaDataFactory
setStoreMode
in interface MetaDataFactory
setStoreMode
in class DelegatingMetaDataFactory
public void setStrict(boolean strict)
MetaDataFactory
setStrict
in interface MetaDataFactory
setStrict
in class DelegatingMetaDataFactory
public void load(Class cls, int mode, ClassLoader envLoader)
MetaDataFactory
MetaDataModes.MODE_QUERY
, the class may be null. Loaded
metadata should be added directly to the repository. It should have
its source mode set appropriately via
ClassMetaData.setSourceMode(int)
.load
in interface MetaDataFactory
load
in class DelegatingMetaDataFactory
mode
- the mode to load metadata in: if mapping information is
stored together with metadata, then you can load mapping
data even if this mode only includes
MODE_META
, so long as
the strict
property hasn't been setpublic boolean store(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, Map output)
MetaDataFactory
store
in interface MetaDataFactory
store
in class DelegatingMetaDataFactory
mode
- hint about what aspects of the metadata have changedoutput
- if non-null, rather than storing metadata directly,
add entries mapping each output destination such
as a File
to the planned output for that
destination in string formpublic boolean drop(Class[] cls, int mode, ClassLoader envLoader)
MetaDataFactory
drop
in interface MetaDataFactory
drop
in class DelegatingMetaDataFactory
public Set getPersistentTypeNames(boolean classpath, ClassLoader envLoader)
MetaDataFactory
MetaDataRepository.getPersistentTypeNames(boolean, java.lang.ClassLoader)
instead.getPersistentTypeNames
in interface MetaDataFactory
getPersistentTypeNames
in class DelegatingMetaDataFactory
MetaDataRepository.getPersistentTypeNames(boolean, java.lang.ClassLoader)
,
MetaDataRepository.loadPersistentTypes(boolean, java.lang.ClassLoader)
public void clear()
MetaDataFactory
clear
in interface MetaDataFactory
clear
in class DelegatingMetaDataFactory
public void addClassExtensionKeys(Collection exts)
MetaDataFactory
addClassExtensionKeys
in interface MetaDataFactory
addClassExtensionKeys
in class DelegatingMetaDataFactory
public void addFieldExtensionKeys(Collection exts)
MetaDataFactory
addFieldExtensionKeys
in interface MetaDataFactory
addFieldExtensionKeys
in class DelegatingMetaDataFactory
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.