|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.tools.hibernate.ExtendedMetadata
public class ExtendedMetadata
extension of the model metadata provided by SessionFactory
. During
construction, the metadata is created and cached for later use.
SessionFactory
Constructor Summary | |
---|---|
ExtendedMetadata()
|
Method Summary | |
---|---|
Set<Class<ome.model.IAnnotated>> |
getAnnotationTypes()
Returns all the classes which implement IAnnotated |
String |
getCountQuery(String field)
Returns the query for obtaining the number of collection items to a particular instance. |
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 attached IObject instances which may need to be locked by the
creation or updating of the argument. |
String[][] |
getLockChecks(Class<? extends ome.model.IObject> klass)
returns all class/field name pairs which may possible link to an object of type klass . |
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()
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 Set<Class<ome.model.IAnnotated>> getAnnotationTypes()
IAnnotated
public ome.model.IObject[] getLockCandidates(ome.model.IObject iObject)
IObject
argument non-recursively and gathers
all attached IObject
instances which may need to be locked by the
creation or updating of the argument.
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 may need to be
locked.Permissions.Flag#LOCKED
public String[][] getLockChecks(Class<? extends ome.model.IObject> klass)
klass
.
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
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: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.