| Method from org.apache.openjpa.meta.MetaDataRepository Detail: |
void addDeclaredInterfaceImpl(ClassMetaData meta,
Class iface) {
synchronized (_impls) {
Collection vals = (Collection) _impls.get(iface);
// check to see if the superclass already declares to avoid dups
if (vals != null) {
ClassMetaData sup = meta.getPCSuperclassMetaData();
for (; sup != null; sup = sup.getPCSuperclassMetaData())
if (vals.contains(sup.getDescribedType()))
return;
}
addToCollection(_impls, iface, meta.getDescribedType(), false);
}
}
Add the given metadata as declared interface implementation. |
public ClassMetaData addMetaData(Class cls) {
return addMetaData(cls, ClassMetaData.ACCESS_UNKNOWN);
}
Create a new metadata, populate it with default information, add it to
the repository, and return it. Use the default access type. |
public ClassMetaData addMetaData(Class cls,
int access) {
if (cls == null || cls.isPrimitive())
return null;
ClassMetaData meta = newClassMetaData(cls);
_factory.getDefaults().populate(meta, access);
// synchronize on this rather than the map, because all other methods
// that access _metas are synchronized on this
synchronized (this) {
if (_pawares.containsKey(cls))
throw new MetaDataException(_loc.get("pc-and-aware", cls));
_metas.put(cls, meta);
}
return meta;
}
Create a new metadata, populate it with default information, add it to
the repository, and return it. |
public NonPersistentMetaData addNonMappedInterface(Class iface) {
if (iface == null)
return null;
if (!iface.isInterface())
throw new MetaDataException(_loc.get("not-non-mapped", iface));
synchronized(this) {
if (_nonMapped.containsKey(iface))
return (NonPersistentMetaData)_nonMapped.get(iface);
if (getCachedMetaData(iface) != null)
throw new MetaDataException(_loc.get("non-mapped-pc", iface));
NonPersistentMetaData meta = new NonPersistentMetaData(iface, this,
NonPersistentMetaData.TYPE_NON_MAPPED_INTERFACE);
_nonMapped.put(iface, meta);
return meta;
}
}
Add the given non-mapped interface to the repository. |
public NonPersistentMetaData addPersistenceAware(Class cls) {
if (cls == null)
return null;
synchronized(this) {
if (_pawares.containsKey(cls))
return (NonPersistentMetaData)_pawares.get(cls);
if (getCachedMetaData(cls) != null)
throw new MetaDataException(_loc.get("pc-and-aware", cls));
NonPersistentMetaData meta = new NonPersistentMetaData(cls, this,
NonPersistentMetaData.TYPE_PERSISTENCE_AWARE);
_pawares.put(cls, meta);
return meta;
}
}
Add the given class as persistence-aware. |
public synchronized QueryMetaData addQueryMetaData(Class cls,
String name) {
QueryMetaData meta = newQueryMetaData(cls, name);
_queries.put(getQueryKey(meta), meta);
return meta;
}
Add a new query metadata to the repository and return it. |
public synchronized SequenceMetaData addSequenceMetaData(String name) {
SequenceMetaData meta = newSequenceMetaData(name);
_seqs.put(name, meta);
return meta;
}
Add a new sequence metadata to the repository and return it. |
public synchronized void addSystemListener(Object listener) {
// copy to avoid issues with ListenerList and avoid unncessary
// locking on the list during runtime
LifecycleEventManager.ListenerList listeners = new
LifecycleEventManager.ListenerList(_listeners);
listeners.add(listener);
_listeners = listeners;
}
Add the given system lifecycle listener. |
public XMLClassMetaData addXMLMetaData(Class type,
String name) {
XMLClassMetaData meta = newXMLClassMetaData(type, name);
// synchronize on this rather than the map, because all other methods
// that access _xmlmetas are synchronized on this
synchronized (this) {
_xmlmetas.put(type, meta);
}
return meta;
}
Create a new metadata, populate it with default information, add it to
the repository, and return it. |
public synchronized void clear() {
if (_log.isTraceEnabled())
_log.trace(_loc.get("clear-repos", this));
_metas.clear();
_oids.clear();
_subs.clear();
_impls.clear();
_queries.clear();
_seqs.clear();
_registered.clear();
_factory.clear();
_aliases.clear();
_pawares.clear();
_nonMapped.clear();
}
Clear the cache of parsed metadata. This method also clears the
internal MetaDataFactory 's cache. |
public synchronized void close() {
SequenceMetaData[] smds = getSequenceMetaDatas();
for (int i = 0; i < smds.length; i++)
smds[i].close();
clear();
}
Free the resources used by this repository. Closes all user sequences. |
public void endConfiguration() {
initializeMetaDataFactory();
if (_implGen == null)
_implGen = new InterfaceImplGenerator(this);
}
|
public Collection getAliasNames() {
Collection aliases = new HashSet();
synchronized (_aliases) {
for (Iterator iter = _aliases.entrySet().iterator();
iter.hasNext(); ) {
Map.Entry e = (Map.Entry) iter.next();
if (e.getValue() != null)
aliases.add(e.getKey());
}
}
return aliases;
}
|
public ClassMetaData getCachedMetaData(Class cls) {
return (ClassMetaData) _metas.get(cls);
}
Return the cached metadata for the given class, without any resolution.
Return null if none. |
public synchronized QueryMetaData getCachedQueryMetaData(Class cls,
String name) {
return (QueryMetaData) _queries.get(getQueryKey(cls, name));
}
Return the cached query metadata for the given name. |
public synchronized SequenceMetaData getCachedSequenceMetaData(String name) {
return (SequenceMetaData) _seqs.get(name);
}
Return the cached a sequence metadata for the given name. |
public XMLMetaData getCachedXMLMetaData(Class cls) {
return (XMLMetaData) _xmlmetas.get(cls);
}
Return the cached XMLClassMetaData for the given class
Return null if none. |
public String getClosestAliasName(String alias) {
Collection aliases = getAliasNames();
return StringDistance.getClosestLevenshteinDistance(alias, aliases);
}
|
public OpenJPAConfiguration getConfiguration() {
return _conf;
}
Return the configuration for the repository. |
InterfaceImplGenerator getImplGenerator() {
return _implGen;
}
|
public ClassMetaData[] getImplementorMetaDatas(Class cls,
ClassLoader envLoader,
boolean mustExist) {
if (cls == null && mustExist)
throw new MetaDataException(_loc.get("no-meta", cls));
if (cls == null)
return EMPTY_METAS;
// get impls of given interface / abstract class
loadRegisteredClassMetaData(envLoader);
Collection vals = (Collection) _impls.get(cls);
ClassMetaData meta;
Collection mapped = null;
if (vals != null) {
synchronized (vals) {
for (Iterator itr = vals.iterator(); itr.hasNext();) {
meta = getMetaData((Class) itr.next(), envLoader, true);
if (meta.isMapped()
|| meta.getMappedPCSubclassMetaDatas().length > 0) {
if (mapped == null)
mapped = new ArrayList(vals.size());
mapped.add(meta);
}
}
}
}
if (mapped == null && mustExist)
throw new MetaDataException(_loc.get("no-meta", cls));
if (mapped == null)
return EMPTY_METAS;
return (ClassMetaData[]) mapped.toArray(newClassMetaDataArray
(mapped.size()));
}
Return all least-derived metadatas with some mapped assignable type that
implement the given class. |
public Log getLog() {
return _log;
}
|
public synchronized ClassMetaData getMetaData(Class cls,
ClassLoader envLoader,
boolean mustExist) {
if (cls != null &&
DynamicPersistenceCapable.class.isAssignableFrom(cls))
cls = cls.getSuperclass();
// if cls is a generated interface, use the user interface
// to locate metadata
if (cls != null && _implGen.isImplType(cls))
cls = _implGen.toManagedInterface(cls);
ClassMetaData meta = getMetaDataInternal(cls, envLoader);
if (meta == null && mustExist) {
if (cls != null &&
!ImplHelper.isManagedType(_conf, cls))
throw new MetaDataException(_loc.get("no-meta-notpc", cls)).
setFatal(false);
Set pcNames = getPersistentTypeNames(false, envLoader);
if (pcNames != null && pcNames.size() > 0)
throw new MetaDataException(_loc.get("no-meta-types",
cls, pcNames));
throw new MetaDataException(_loc.get("no-meta", cls));
}
resolve(meta);
return meta;
}
Return the metadata for the given class. |
public ClassMetaData getMetaData(String alias,
ClassLoader envLoader,
boolean mustExist) {
if (alias == null && mustExist)
throw new MetaDataException(_loc.get("no-alias-meta", alias,
_aliases));
if (alias == null)
return null;
// check cache
processRegisteredClasses(envLoader);
List classList = (List) _aliases.get(alias);
// multiple classes may have been defined with the same alias: we
// will filter by checking against the current list of the
// persistent types and filter based on which classes are loadable
// via the current environment's ClassLoader
Set pcNames = getPersistentTypeNames(false, envLoader);
Class cls = null;
for (int i = 0; classList != null && i < classList.size(); i++) {
Class c = (Class) classList.get(i);
try {
// re-load the class in the current environment loader so
// that we can handle redeployment of the same class name
Class nc = Class.forName(c.getName(), false, envLoader);
// if we have specified a list of persistent clases,
// also check to ensure that the class is in that list
if (pcNames == null || pcNames.size() == 0
|| pcNames.contains(nc.getName())) {
cls = nc;
if (!classList.contains(cls))
classList.add(cls);
break;
}
} catch (Throwable t) {
// this happens when the class is not loadable by
// the environment class loader, so it was probably
// listed elsewhere; also ignore linkage failures and
// other class loading problems
}
}
if (cls != null)
return getMetaData(cls, envLoader, mustExist);
// maybe this is some type we've seen but just isn't valid
if (_aliases.containsKey(alias)) {
if (mustExist)
throwNoRegisteredAlias(alias);
return null;
}
// record that this is an invalid type
_aliases.put(alias, null);
if (!mustExist)
return null;
return throwNoRegisteredAlias(alias);
}
Return the metadata for the given alias name. |
public ClassMetaData getMetaData(Object oid,
ClassLoader envLoader,
boolean mustExist) {
if (oid == null && mustExist)
throw new MetaDataException(_loc.get("no-oid-meta", oid, "?",
_oids.toString()));
if (oid == null)
return null;
if (oid instanceof OpenJPAId) {
Class cls = ((OpenJPAId) oid).getType();
return getMetaData(cls, envLoader, mustExist);
}
// check cache
processRegisteredClasses(envLoader);
Class cls = (Class) _oids.get(oid.getClass());
if (cls != null)
return getMetaData(cls, envLoader, mustExist);
// maybe this is some type we've seen but just isn't valid
if (_oids.containsKey(oid.getClass())) {
if (mustExist)
throw new MetaDataException(_loc.get("no-oid-meta", oid,
oid.getClass(), _oids));
return null;
}
// if still not match, register any classes that look similar to the
// oid class and check again
resolveIdentityClass(oid);
if (processRegisteredClasses(envLoader).length > 0) {
cls = (Class) _oids.get(oid.getClass());
if (cls != null)
return getMetaData(cls, envLoader, mustExist);
}
// record that this is an invalid type
_oids.put(oid.getClass(), null);
if (!mustExist)
return null;
throw new MetaDataException(_loc.get("no-oid-meta", oid,
oid.getClass(), _oids)).setFailedObject(oid);
}
Return the least-derived class metadata for the given application
identity object. |
public MetaDataFactory getMetaDataFactory() {
return _factory;
}
The I/O used to load metadata. |
public synchronized ClassMetaData[] getMetaDatas() {
// prevent concurrent mod errors when resolving one metadata
// introduces others
ClassMetaData[] metas = (ClassMetaData[]) _metas.values().
toArray(new ClassMetaData[_metas.size()]);
for (int i = 0; i < metas.length; i++)
if (metas[i] != null)
getMetaData(metas[i].getDescribedType(),
metas[i].getEnvClassLoader(), true);
List resolved = new ArrayList(_metas.size());
ClassMetaData meta;
for (Iterator itr = _metas.values().iterator(); itr.hasNext();) {
meta = (ClassMetaData) itr.next();
if (meta != null)
resolved.add(meta);
}
metas = (ClassMetaData[]) resolved.toArray
(newClassMetaDataArray(resolved.size()));
Arrays.sort(metas);
return metas;
}
Return all the metadata instances currently in the repository. |
public NonPersistentMetaData getNonMappedInterface(Class iface) {
return (NonPersistentMetaData)_nonMapped.get(iface);
}
Gets the metadata corresponding to the given non-mapped interface.
Returns null, if the given interface is not registered as
persistence-aware. |
public NonPersistentMetaData[] getNonMappedInterfaces() {
synchronized (_nonMapped) {
if (_nonMapped.isEmpty())
return EMPTY_NON_PERSISTENT;
return (NonPersistentMetaData[])_nonMapped.values().toArray
(new NonPersistentMetaData[_nonMapped.size()]);
}
}
Gets the corresponding metadatas for all registered, non-mapped
interfaces |
Collection getPCSubclasses(Class cls) {
Collection subs = (Collection) _subs.get(cls);
if (subs == null)
return Collections.EMPTY_LIST;
return subs;
}
Return all known subclasses for the given class mapping. Note
that this method only works during runtime when the repository is
registered as a RegisterClassListener . |
public NonPersistentMetaData getPersistenceAware(Class cls) {
return (NonPersistentMetaData)_pawares.get(cls);
}
Gets the metadata corresponding to the given persistence-aware class.
Returns null, if the given class is not registered as
persistence-aware. |
public NonPersistentMetaData[] getPersistenceAwares() {
synchronized (_pawares) {
if (_pawares.isEmpty())
return EMPTY_NON_PERSISTENT;
return (NonPersistentMetaData[])_pawares.values().toArray
(new NonPersistentMetaData[_pawares.size()]);
}
}
Gets all the metadatas for persistence-aware classes |
public synchronized Set getPersistentTypeNames(boolean devpath,
ClassLoader envLoader) {
return _factory.getPersistentTypeNames(devpath, envLoader);
}
Return the set of configured persistent classes, or null if the user
did not configure any. |
protected static Object getQueryKey(Class cls,
String name) {
if (cls == null)
return name;
QueryKey key = new QueryKey();
key.clsName = cls.getName();
key.name = name;
return key;
}
Return a unique key for a given class / name. The class
argument can be null. |
public synchronized QueryMetaData getQueryMetaData(Class cls,
String name,
ClassLoader envLoader,
boolean mustExist) {
QueryMetaData meta = getQueryMetaDataInternal(cls, name, envLoader);
if (meta == null) {
// load all the metadatas for all the known classes so that
// query names are seen and registered
resolveAll(envLoader);
meta = getQueryMetaDataInternal(cls, name, envLoader);
}
if (meta == null && mustExist) {
if (cls == null) {
throw new MetaDataException(_loc.get
("no-named-query-null-class",
getPersistentTypeNames(false, envLoader), name));
} else {
throw new MetaDataException(_loc.get("no-named-query",
cls, name));
}
}
return meta;
}
Return query metadata for the given class, name, and classloader. |
public synchronized QueryMetaData[] getQueryMetaDatas() {
return (QueryMetaData[]) _queries.values().toArray
(new QueryMetaData[_queries.size()]);
}
Return the cached query metadata. |
public int getResolve() {
return _resMode;
}
The metadata resolution mode. Defaults to
MODE_META | MODE_MAPPING. |
public synchronized SequenceMetaData getSequenceMetaData(String name,
ClassLoader envLoader,
boolean mustExist) {
SequenceMetaData meta = getSequenceMetaDataInternal(name, envLoader);
if (meta == null && SequenceMetaData.NAME_SYSTEM.equals(name)) {
if (_sysSeq == null)
_sysSeq = newSequenceMetaData(name);
return _sysSeq;
}
if (meta == null && mustExist)
throw new MetaDataException(_loc.get("no-named-sequence", name));
return meta;
}
Return sequence metadata for the given name and classloader. |
SequenceMetaData getSequenceMetaData(ClassMetaData context,
String name,
boolean mustExist) {
// try with given name
MetaDataException e = null;
try {
SequenceMetaData seq = getSequenceMetaData(name,
context.getEnvClassLoader(), mustExist);
if (seq != null)
return seq;
} catch (MetaDataException mde) {
e = mde;
}
// if given name already fully qualified, give up
if (name.indexOf('.") != -1) {
if (e != null)
throw e;
return null;
}
// try with qualified name
name = Strings.getPackageName(context.getDescribedType())
+ "." + name;
try {
return getSequenceMetaData(name, context.getEnvClassLoader(),
mustExist);
} catch (MetaDataException mde) {
// throw original exception
if (e != null)
throw e;
throw mde;
}
}
Used internally by metadata to retrieve sequence metadatas based on
possibly-unqualified sequence name. |
public synchronized SequenceMetaData[] getSequenceMetaDatas() {
return (SequenceMetaData[]) _seqs.values().toArray
(new SequenceMetaData[_seqs.size()]);
}
Return the cached sequence metadata. |
public int getSourceMode() {
return _sourceMode;
}
The source mode determining what metadata to load. Defaults to
MODE_META | MODE_MAPPING | MODE_QUERY. |
public LifecycleEventManager.ListenerList getSystemListeners() {
return _listeners;
}
Return the system lifecycle listeners |
public int getValidate() {
return _validate;
}
The metadata validation level. Defaults to
VALIDATE_META | VALIDATE_UNENHANCED. |
public synchronized XMLMetaData getXMLMetaData(FieldMetaData fmd) {
Class cls = fmd.getDeclaredType();
// check if cached before
XMLMetaData xmlmeta = (XMLClassMetaData) _xmlmetas.get(cls);
if (xmlmeta != null)
return xmlmeta;
// load JAXB XML metadata
_factory.loadXMLMetaData(fmd);
xmlmeta = (XMLClassMetaData) _xmlmetas.get(cls);
return xmlmeta;
}
Return XML metadata for a given field metadata |
public synchronized Collection loadPersistentTypes(boolean devpath,
ClassLoader envLoader) {
Set names = getPersistentTypeNames(devpath, envLoader);
if (names == null || names.isEmpty())
return Collections.EMPTY_LIST;
// attempt to load classes so that they get processed
ClassLoader clsLoader = _conf.getClassResolverInstance().
getClassLoader(getClass(), envLoader);
List classes = new ArrayList(names.size());
Class cls;
for (Iterator itr = names.iterator(); itr.hasNext();) {
cls = classForName((String) itr.next(), clsLoader);
if (cls != null) {
classes.add(cls);
// if the class is an interface, load its metadata to kick
// off the impl generator
if (cls.isInterface())
getMetaData(cls, clsLoader, false);
}
}
return classes;
}
Load the persistent classes named in configuration.
This ensures that all subclasses and application identity classes of
each type are known in advance, without having to rely on the
application loading the classes before performing operations that
might involve them. |
protected ClassMetaData newClassMetaData(Class type) {
return new ClassMetaData(type, this);
}
Create a new class metadata instance. |
protected ClassMetaData[] newClassMetaDataArray(int length) {
return new ClassMetaData[length];
}
Create a new array of the proper class metadata subclass. |
protected ClassMetaData newEmbeddedClassMetaData(ValueMetaData owner) {
return new ClassMetaData(owner);
}
Create a new embedded class metadata instance. |
protected FieldMetaData newFieldMetaData(String name,
Class type,
ClassMetaData owner) {
return new FieldMetaData(name, type, owner);
}
Create a new field metadata instance. |
protected FieldMetaData[] newFieldMetaDataArray(int length) {
return new FieldMetaData[length];
}
Create a new array of the proper field metadata subclass. |
protected Order newOrder(FieldMetaData owner,
String name,
boolean asc) {
// paths can start with (or equal) '#element'
if (name.startsWith(Order.ELEMENT))
name = name.substring(Order.ELEMENT.length());
if (name.length() == 0)
return newValueOrder(owner, asc);
// next token should be '.'
if (name.charAt(0) == '.")
name = name.substring(1);
// related field
ClassMetaData meta = owner.getElement().getTypeMetaData();
if (meta == null)
throw new MetaDataException(_loc.get("nonpc-field-orderable",
owner, name));
FieldMetaData rel = meta.getField(name);
if (rel == null)
throw new MetaDataException(_loc.get("bad-field-orderable",
owner, name));
return newRelatedFieldOrder(owner, rel, asc);
}
|
protected Order[] newOrderArray(int size) {
return new Order[size];
}
Create an array of orders of the given size. |
protected QueryMetaData newQueryMetaData(Class cls,
String name) {
QueryMetaData meta = new QueryMetaData(name);
meta.setDefiningType(cls);
return meta;
}
Create a new query metadata instance. |
protected Order newRelatedFieldOrder(FieldMetaData owner,
FieldMetaData rel,
boolean asc) {
return new InMemoryRelatedFieldOrder(rel, asc, getConfiguration());
}
Order by a field of the related type. |
protected SequenceMetaData newSequenceMetaData(String name) {
return new SequenceMetaData(name, this);
}
Create a new sequence metadata instance. |
protected ValueMetaData newValueMetaData(FieldMetaData owner) {
return new ValueMetaDataImpl(owner);
}
Create a new value metadata instance. |
protected Order newValueOrder(FieldMetaData owner,
boolean asc) {
return new InMemoryValueOrder(asc, getConfiguration());
}
Order by the field value. |
protected XMLClassMetaData newXMLClassMetaData(Class type,
String name) {
return new XMLClassMetaData(type, name);
}
Create a new xml class metadata |
protected XMLMetaData[] newXMLClassMetaDataArray(int length) {
return new XMLClassMetaData[length];
}
Create a new array of the proper xml class metadata subclass. |
public XMLFieldMetaData newXMLFieldMetaData(Class type,
String name) {
return new XMLFieldMetaData(type, name);
}
Create a new xml field meta, add it to the fieldMap in the given
xml class metadata |
protected void prepareMapping(ClassMetaData meta) {
meta.defineSuperclassFields(false);
}
Prepare metadata for mapping resolution. This method might map parts
of the metadata that don't rely on other classes being mapped, but that
other classes might rely on during their own mapping (for example,
primary key fields). By default, this method only calls
ClassMetaData#defineSuperclassFields . |
Class[] processRegisteredClasses(ClassLoader envLoader) {
if (_registered.isEmpty())
return EMPTY_CLASSES;
// copy into new collection to avoid concurrent mod errors on reentrant
// registrations
Class[] reg;
synchronized (_registered) {
reg = (Class[]) _registered.toArray(new Class[_registered.size()]);
_registered.clear();
}
Collection pcNames = getPersistentTypeNames(false, envLoader);
Collection failed = null;
for (int i = 0; i < reg.length; i++) {
// don't process types that aren't listed by the user; may belong
// to a different persistence unit
if (pcNames != null && !pcNames.isEmpty()
&& !pcNames.contains(reg[i].getName()))
continue;
try {
processRegisteredClass(reg[i]);
} catch (Throwable t) {
if (!_conf.getRetryClassRegistration())
throw new MetaDataException(_loc.get("error-registered",
reg[i]), t);
if (_log.isWarnEnabled())
_log.warn(_loc.get("failed-registered", reg[i]), t);
if (failed == null)
failed = new ArrayList();
failed.add(reg[i]);
}
}
if (failed != null) {
synchronized (_registered) {
_registered.addAll(failed);
}
}
return reg;
}
Updates our datastructures with the latest registered classes. |
public void register(Class cls) {
// buffer registered classes until an oid metadata request is made,
// at which point we'll parse everything in the buffer
synchronized (_registered) {
_registered.add(cls);
}
}
|
public boolean removeMetaData(ClassMetaData meta) {
if (meta == null)
return false;
return removeMetaData(meta.getDescribedType());
}
Remove a metadata instance from the repository. |
public synchronized boolean removeMetaData(Class cls) {
if (cls == null)
return false;
if (_metas.remove(cls) != null) {
Class impl = (Class) _ifaces.remove(cls);
if (impl != null)
_metas.remove(impl);
return true;
}
return false;
}
Remove a metadata instance from the repository. |
public boolean removeNonMappedInterface(Class iface) {
return _nonMapped.remove(iface) != null;
}
Remove a non-mapped interface from the repository |
public boolean removePersistenceAware(Class cls) {
return _pawares.remove(cls) != null;
}
Remove a persitence-aware class from the repository |
public synchronized boolean removeQueryMetaData(QueryMetaData meta) {
if (meta == null)
return false;
return _queries.remove(getQueryKey(meta)) != null;
}
Remove the given query metadata from the repository. |
public synchronized boolean removeQueryMetaData(Class cls,
String name) {
if (name == null)
return false;
return _queries.remove(getQueryKey(cls, name)) != null;
}
Remove query metadata for the given class name if in the repository. |
public synchronized boolean removeSequenceMetaData(SequenceMetaData meta) {
if (meta == null)
return false;
return _seqs.remove(meta.getName()) != null;
}
Remove the given sequence metadata from the repository. |
public synchronized boolean removeSequenceMetaData(String name) {
if (name == null)
return false;
return _seqs.remove(name) != null;
}
Remove sequence metadata for the name if in the repository. |
public synchronized boolean removeSystemListener(Object listener) {
if (!_listeners.contains(listener))
return false;
// copy to avoid issues with ListenerList and avoid unncessary
// locking on the list during runtime
LifecycleEventManager.ListenerList listeners = new
LifecycleEventManager.ListenerList(_listeners);
listeners.remove(listener);
_listeners = listeners;
return true;
}
Remove the given system lifecycle listener. |
public void setConfiguration(Configuration conf) {
_conf = (OpenJPAConfiguration) conf;
_log = _conf.getLog(OpenJPAConfiguration.LOG_METADATA);
}
|
synchronized void setInterfaceImpl(ClassMetaData meta,
Class impl) {
if (!meta.isManagedInterface())
throw new MetaDataException(_loc.get("not-managed-interface",
meta, impl));
_ifaces.put(meta.getDescribedType(), impl);
addDeclaredInterfaceImpl(meta, meta.getDescribedType());
ClassMetaData sup = meta.getPCSuperclassMetaData();
while (sup != null) {
// record superclass interface info while we can as well as we
// will only register concrete superclass in PCRegistry
sup.clearSubclassCache();
addToCollection(_subs, sup.getDescribedType(), impl, true);
sup = (ClassMetaData) sup.getPCSuperclassMetaData();
}
}
Set the implementation for the given managed interface. |
public void setMetaDataFactory(MetaDataFactory factory) {
factory.setRepository(this);
_factory = factory;
}
The I/O used to load metadata. |
public void setResolve(int mode) {
_resMode = mode;
}
The metadata resolution mode. Defaults to
MODE_META | MODE_MAPPING. |
public void setResolve(int mode,
boolean on) {
if (mode == MODE_NONE)
_resMode = mode;
else if (on)
_resMode |= mode;
else
_resMode &= ~mode;
}
The metadata resolution mode. Defaults to
MODE_META | MODE_MAPPING. |
public void setSourceMode(int mode) {
_sourceMode = mode;
}
The source mode determining what metadata to load. Defaults to
MODE_META | MODE_MAPPING | MODE_QUERY. |
public void setSourceMode(int mode,
boolean on) {
if (mode == MODE_NONE)
_sourceMode = mode;
else if (on)
_sourceMode |= mode;
else
_sourceMode &= ~mode;
}
The source mode determining what metadata to load. Defaults to
MODE_META | MODE_MAPPING | MODE_QUERY. |
public void setValidate(int validate) {
_validate = validate;
}
The metadata validation level. Defaults to
VALIDATE_META | VALIDATE_UNENHANCED. |
public void setValidate(int validate,
boolean on) {
if (validate == VALIDATE_NONE)
_validate = validate;
else if (on)
_validate |= validate;
else
_validate &= ~validate;
}
The metadata validation level. Defaults to
VALIDATE_META | VALIDATE_MAPPING | VALIDATE_UNENHANCED. |
public void startConfiguration() {
}
|