ome.tools.hibernate
Interface ExtendedMetadata

All Known Implementing Classes:
ExtendedMetadata.Impl

public interface ExtendedMetadata

extension of the model metadata provided by SessionFactory. During construction, the metadata is created and cached for later use.

Since:
3.0-M3
Version:
$Revision: 8129 $, $Date: 2010-09-27 12:37:11 +0100 (Mon, 27 Sep 2010) $
Author:
Josh Moore, josh.moore at gmx.de
See Also:
SessionFactory

Nested Class Summary
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.
 
Method Summary
 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
 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.
 ome.model.IObject[] getLockCandidates(ome.model.IObject iObject)
          walks the IObject argument non-recursively and gathers all IObject instances which will be linkd 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.
 

Method Detail

getAnnotatableTypes

Set<Class<ome.model.IAnnotated>> getAnnotatableTypes()
Returns all the classes which implement IAnnotated


getAnnotationTypes

Set<Class<ome.model.annotations.Annotation>> getAnnotationTypes()
Returns all the classes which subclass Annotation


getCountQuery

String getCountQuery(String field)
                     throws ome.conditions.ApiUsageException
Returns the query for obtaining the number of collection items to a particular instance. All such queries will return a ResultSet with rows of the form: 0 (Long) id of the locked class 1 (Long) count of the instances locking that class

Parameters:
field - Field name as specified in the class.
Returns:
String query. Never null.
Throws:
ome.conditions.ApiUsageException - if return value would be null.

getHibernateClass

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.


getLockCandidates

ome.model.IObject[] getLockCandidates(ome.model.IObject iObject)
walks the IObject argument non-recursively and gathers all IObject instances which will be linkd 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)

Parameters:
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.
Returns:
A non-null array of IObjects which will be linked to.

getLockChecks

String[][] getLockChecks(Class<? extends ome.model.IObject> klass)
returns all class/field name pairs which may possibly link to an object of type klass.

Parameters:
klass - Non-null subclass of IObject
Returns:
A non-null array of String queries which can be used to determine if an IObject instance can be unlocked.
See Also:
Permissions.Flag#LOCKED

getRelationship

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. If there is, the name will be returned. Otherwise, null.



OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.