|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.tools.hibernate.ExtendedMetadata.Impl
public static class ExtendedMetadata.Impl
Sole implementatino of ExtendedMetadata. The separation is intended to make
unit testing without a full ExtendedMetadata
possible.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface ome.tools.hibernate.ExtendedMetadata |
---|
ExtendedMetadata.Immutables, ExtendedMetadata.Impl, ExtendedMetadata.Locks |
Constructor Summary | |
---|---|
ExtendedMetadata.Impl()
|
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. |
String[] |
getImmutableFields(Class<? extends ome.model.IObject> klass)
|
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 th
"to" argument. |
Class<ome.model.IObject> |
getTargetType(String field)
Returns the IObject type which a given field points to. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
Listener method which waits for a ContextRefreshedEvent and then
extracts the SessionFactory from the ApplicationContext
and pases it to setSessionFactory(SessionFactory) . |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Initializes the metadata needed by this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtendedMetadata.Impl()
Method Detail |
---|
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
ContextRefreshedEvent
and then
extracts the SessionFactory
from the ApplicationContext
and pases it to setSessionFactory(SessionFactory)
.
onApplicationEvent
in interface org.springframework.context.ApplicationListener
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- SessionFactory#getAllClassMetadata()
public Class<ome.model.IObject> getHibernateClass(String table)
ExtendedMetadata
getHibernateClass
in interface ExtendedMetadata
public String getRelationship(String from, String to)
locksHolder
and the lockedByHolder
data
for "from" argument to see if there is any direct relationship to th
"to" argument. If there is, the name will be returned. Otherwise, null.
getRelationship
in interface ExtendedMetadata
public Set<Class<ome.model.IAnnotated>> getAnnotatableTypes()
ExtendedMetadata
IAnnotated
getAnnotatableTypes
in interface ExtendedMetadata
public Set<Class<ome.model.annotations.Annotation>> getAnnotationTypes()
ExtendedMetadata
Annotation
getAnnotationTypes
in interface ExtendedMetadata
public ome.model.IObject[] getLockCandidates(ome.model.IObject iObject)
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)
getLockCandidates
in interface ExtendedMetadata
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.public String[][] getLockChecks(Class<? extends ome.model.IObject> klass)
klass
.
getLockChecks
in interface ExtendedMetadata
klass
- Non-null subclass
of IObject
String
queries which can be used to
determine if an IObject
instance can be unlocked.Permissions.Flag#LOCKED
public String[] getImmutableFields(Class<? extends ome.model.IObject> klass)
public String getCountQuery(String field) throws ome.conditions.ApiUsageException
getCountQuery
in interface ExtendedMetadata
field
- Field name as specified in the class.
ome.conditions.ApiUsageException
- if return value would be null.public Class<ome.model.IObject> getTargetType(String field) throws ome.conditions.ApiUsageException
IObject
type which a given field points to. E.g.
getTargetType(ImageAnnotation.IMAGE) returns Image.class.
ome.conditions.ApiUsageException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta4.2.1-r8614-Beta4.2-b41
Copyright © 2009 The University of Dundee. All Rights Reserved.