|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.graphs.BaseGraphSpec
ome.services.graphs.AnnotationGraphSpec
public class AnnotationGraphSpec
GraphSpec
specialized for deleting annotations. Adds options which
classes to delete as well as which namespaces.
IGraph
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ome.services.graphs.BaseGraphSpec |
---|
BaseGraphSpec.SubSpecIterator |
Field Summary | |
---|---|
static Set<String> |
nsExcludes
Collection of namespace values (defined as nsIncludes ) which
will be omitted from deletes by default. |
static Set<String> |
nsIncludes
Collection of namespace values (or LIKE values if they contain '%' or '?') |
Fields inherited from class ome.services.graphs.BaseGraphSpec |
---|
entries, id, options, superspec |
Constructor Summary | |
---|---|
AnnotationGraphSpec(List<String> entries)
Creates a new instance. |
|
AnnotationGraphSpec(Map<String,String> excludeMap,
List<String> entries)
Creates a new instance. |
Method Summary | |
---|---|
String |
getExclude(int step)
Returns the value from "... |
int |
initialize(long id,
String superspec,
Map<String,String> dontmodify)
Called as each delete command is started. |
boolean |
overrideKeep()
Returns true to prevent skipping of the entire subspec if there were any "excludes" passed in with the options. |
long[][] |
queryBackupIds(org.hibernate.Session session,
int step,
GraphEntry subpath,
QueryBuilder and)
If a given path is deleted before its sub-path, this points to a one-to-one relationship. |
void |
runTopLevel(org.hibernate.Session session,
List<Long> ids)
Workaround for the removal of GraphSpec#delete when refactoring to GraphState . |
void |
setExtendedMetadata(ExtendedMetadata em)
Performs sanity checks on the annotation entries found in ExtendedMetadata . |
Methods inherited from class ome.services.graphs.BaseGraphSpec |
---|
close, entries, getCurrentDetails, getHibernateClass, getName, getSuperSpec, join, postProcess, setBeanName, setCurrentDetails, toString, walk |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Set<String> nsIncludes
public static final Set<String> nsExcludes
nsIncludes
) which
will be omitted from deletes by default.
Constructor Detail |
---|
public AnnotationGraphSpec(List<String> entries)
entries
- The entries to handle.public AnnotationGraphSpec(Map<String,String> excludeMap, List<String> entries)
excludeMap
- The namespaces to exclude.entries
- The entries to handle.Method Detail |
---|
public String getExclude(int step)
#initialize(long, String, Map)
.
Used primarily for testing.
public void setExtendedMetadata(ExtendedMetadata em)
ExtendedMetadata
.
Primarily, this prevents new annotation 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
GraphSpec
#delete(Session, int)
can take clean up actions.
initialize
in interface GraphSpec
initialize
in class BaseGraphSpec
id
- identifier of the root object which defines the graph to be
deleted.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
supersec 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
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 deleted first, can
be removed.
For example,
/Channel /Channel/StatsInforequires the Channel to be deleted 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
public boolean overrideKeep()
overrideKeep
in interface GraphSpec
overrideKeep
in class BaseGraphSpec
public void runTopLevel(org.hibernate.Session session, List<Long> ids)
GraphSpec
GraphState
. If more logic is needed by subclasses, then
GraphSpec.queryBackupIds(Session, int, GraphEntry, QueryBuilder)
should no longer return list of ids, but rather a "Action" class
so that it can inject its own logic as needed, though it would be necessary
to give that method its place in the graph to detect "top-ness".
runTopLevel
in interface GraphSpec
runTopLevel
in class BaseGraphSpec
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.4-dbcbce5a-b4
Copyright © 2009 The University of Dundee. All Rights Reserved.