public interface ExtendedMetadata
SessionFactory
. During
construction, the metadata is created and cached for later use.SessionFactory
Modifier and Type | Interface and Description |
---|---|
static class |
ExtendedMetadata.Immutables |
static class |
ExtendedMetadata.Impl
Sole implementatino of ExtendedMetadata.
|
static class |
ExtendedMetadata.Locks
inner class which wraps the information (index number, path, etc) related to
what fields a particular object can lock.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Long> |
countLocks(org.hibernate.Session session,
Long id,
String[][] lockChecks,
String clause)
Takes the lock checks returned by
getLockChecks(Class) and
performs the actual check returning a map from class to total number
of locks. |
Set<Class<ome.model.IAnnotated>> |
getAnnotatableTypes()
Returns all the classes which implement
IAnnotated |
Set<Class<ome.model.annotations.Annotation>> |
getAnnotationTypes()
Returns all the classes which subclass
Annotation |
Set<String> |
getClasses() |
String |
getCountQuery(String field)
Returns the query for obtaining the number of collection items to a
particular instance.
|
Class<ome.model.IObject> |
getHibernateClass(String table)
Given the name of a database table or alternatively the simple class name
(non-fully qualified) of an IObject, this method returns the class which
Hibernate will map that table to.
|
String[][] |
getLockCandidateChecks(Class<? extends ome.model.IObject> klass,
boolean onlyWithGroups)
Rather than iterating over an
IObject like
getLockCandidates(IObject) this method returns type/field name
pairs (like getLockChecks(Class) ) to allow performing the
queries manually. |
ome.model.IObject[] |
getLockCandidates(ome.model.IObject iObject)
walks the
IObject argument non-recursively and gathers
all IObject instances which will be linked to by the
creation or updating of the argument. |
String[][] |
getLockChecks(Class<? extends ome.model.IObject> klass)
returns all class/field name pairs which may possibly link to an object
of type
klass . |
String |
getRelationship(String from,
String to)
Walks both the
#locksHolder and the #lockedByHolder data
for "from" argument to see if there is any direct relationship to the
"to" argument. |
Set<Class<ome.model.IAnnotated>> getAnnotatableTypes()
IAnnotated
Set<Class<ome.model.annotations.Annotation>> getAnnotationTypes()
Annotation
String getCountQuery(String field) throws ome.conditions.ApiUsageException
field
- Field name as specified in the class.ome.conditions.ApiUsageException
- if return value would be null.Class<ome.model.IObject> getHibernateClass(String table)
ome.model.IObject[] getLockCandidates(ome.model.IObject iObject)
IObject
argument non-recursively and gathers
all IObject
instances which will be linked to by the
creation or updating of the argument. (Previously this was called "locking"
since a flag was set on the object to mark it as linked, but this was
removed in 4.2)iObject
- A newly created or updated IObject
instance which
might possibly lock other IObjects
. A null
argument will return an empty array to be checked.IObjects
which will be linked to.String[][] getLockCandidateChecks(Class<? extends ome.model.IObject> klass, boolean onlyWithGroups)
IObject
like
getLockCandidates(IObject)
this method returns type/field name
pairs (like getLockChecks(Class)
) to allow performing the
queries manually.
If onlyWithGroups is true, then only checks which point to non-IGlobal
objects will be returned.klass
- Not null.String[][] getLockChecks(Class<? extends ome.model.IObject> klass)
klass
.Map<String,Long> countLocks(org.hibernate.Session session, Long id, String[][] lockChecks, String clause)
getLockChecks(Class)
and
performs the actual check returning a map from class to total number
of locks. The key "*" contains the total value.
If the id argument is null, then checks will be against all rows rather
than individual objects, e.g.
select count(x) from Linker x, Linked y where x.$FIELD.id = y.id $CLAUSE;otherwise
select count(x) from Linker x where x.$FIELD.id = :id $CLAUSE'If the clause argument is null or empty it will be omitted.
id
- lockChecks
- clause
-
Version: 4.4.12-ice34-b116
Copyright © 2014 The University of Dundee & Open Microscopy Environment. All Rights Reserved.