@Deprecated public abstract class AbstractHierarchyGraphSpec extends BaseGraphSpec
GraphSpec
specialized for processing hierarchies of
other types. Adds options for which classes to process.IGraph
,
ticket:9435
BaseGraphSpec.SubSpecIterator
Modifier and Type | Field and Description |
---|---|
protected boolean[] |
isAbstract
Deprecated.
Whether or not the type of types[i] is abstract.
|
protected String[] |
optSource
Deprecated.
Key from the options map which was the source of the rawOption value of
the same index.
|
protected String[] |
rawOption
Deprecated.
Original string contained in the options
Map before parsing. |
protected Class<?>[] |
types
Deprecated.
Type of each sub-step.
|
Constructor and Description |
---|
AbstractHierarchyGraphSpec(List<String> entries)
Deprecated.
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Class |
getRoot()
Deprecated.
Return the root class for this hierarchy.
|
protected abstract <T> Set<Class<T>> |
getTypes(ExtendedMetadata em)
Deprecated.
Returns all the types that are known for this hierarchy.
|
protected abstract void |
handleOptions(int i,
String[] parts)
Deprecated.
Called once per loop iteration throw rawOptions during
initialize(long, String, Map) |
int |
initialize(long id,
String superspec,
Map<String,String> dontmodify)
Deprecated.
In order to allow subclasses like the AnnotationGraphSpec to make use
of this method, hooks have been added.
|
protected abstract boolean |
isOverrideKeep(int step,
QueryBuilder and,
String alias)
Deprecated.
If
BaseGraphSpec.overrideKeep() returns true for a subclass, then this method
will likely want to (at least sometimes) return a true value. |
protected abstract void |
postProcessOptions()
Deprecated.
If any options exist, this method will be called to finalize any of
the processing done by
handleOptions(int, String[]) . |
long[][] |
queryBackupIds(org.hibernate.Session session,
int step,
GraphEntry subpath,
QueryBuilder and)
Deprecated.
If a given path is processed before its sub-path, this points to a
one-to-one relationship.
|
void |
setExtendedMetadata(ExtendedMetadata em)
Deprecated.
Performs sanity checks on the entries found in
ExtendedMetadata . |
buildQuery, chgrpQuery, chmodQuery, createQueryBuilder, deleteQuery, entries, getHibernateClass, getName, getSuperSpec, groupInfo, join, joinDataset, joinPlate, load, overrideKeep, parseResults, permissionsClause, postProcess, runQuery, setBeanName, toString, walk, walk
protected final boolean[] isAbstract
protected final Class<?>[] types
true
.protected final String[] rawOption
Map
before parsing. The
value may come from one of several sources, e.g. for a FileAnnotation the
keys checked are:
/abspath/FileAnnotation /FileAnnotation /abspath/TypeAnnotation /TypeAnnotation /abspath/Annotation /Annotation
protected final String[] optSource
protected abstract Class getRoot()
protected abstract <T> Set<Class<T>> getTypes(ExtendedMetadata em)
public void setExtendedMetadata(ExtendedMetadata em)
ExtendedMetadata
.
Primarily, this prevents new types from not being properly specified
in spec.xml.setExtendedMetadata
in class BaseGraphSpec
public int initialize(long id, String superspec, Map<String,String> dontmodify) throws GraphException
initialize
in interface GraphSpec
initialize
in class BaseGraphSpec
id
- identifier of the root object which defines the graph to be
processed.superspec
- points to the relationship between the root object and the
current graph. In many cases, this value will be null so that
the current object is taken to be the root, but if this is a
subspec, or a non-standard naming is being used, then the
superspec will be used.dontmodify
- possibly null or empty map of options which can override the
operations provided in the definition of the specification.
For example, if the spec "/Image" defines "/Image/Annotation"
as "HARD" (the default), then the options map could contain
{"/Image/Annotation":"ORPHAN"}to modify that setting.
GraphException
handleOptions(int, String[])
protected abstract void handleOptions(int i, String[] parts)
initialize(long, String, Map)
i
- Index into rawOption
which is being processed.parts
- semi-colon split values of rawOptions[i]protected abstract void postProcessOptions()
handleOptions(int, String[])
.public long[][] queryBackupIds(org.hibernate.Session session, int step, GraphEntry subpath, QueryBuilder and) throws GraphException
GraphSpec
#initialize(long, Map)
so that foreign key
constraints which require a higher level object to be processed first, can
be processed.
For example,
/Channel /Channel/StatsInforequires the Channel to be processed first, but without the Channel, there's no way to detect which StatsInfo should be removed. Therefore,
#backupIds
in this case would contain:
[ null, # Nothing for Channel. [1,2,3], # The ids of all StatsInfo object which should be removed. ]
queryBackupIds
in interface GraphSpec
queryBackupIds
in class BaseGraphSpec
GraphException
protected abstract boolean isOverrideKeep(int step, QueryBuilder and, String alias)
BaseGraphSpec.overrideKeep()
returns true for a subclass, then this method
will likely want to (at least sometimes) return a true value. When it
returns true, then it should also modify the QueryBuilder
in
order to properly filter for only those objects of interest. If a false
is returned, then no IDs will be queried for this entity.
Version: 5.1.3-ice35-b52
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.