ome.tools.hibernate
Class ExtendedMetadata.Locks

java.lang.Object
  extended by ome.tools.hibernate.ExtendedMetadata.Locks
Enclosing interface:
ExtendedMetadata

public static class ExtendedMetadata.Locks
extends Object

inner class which wraps the information (index number, path, etc) related to what fields a particular object can lock. This is fairly complicated because though the properties available are a simple array, some of those properties can actually be embedded components, meaning that the value of the property is the instance itself. In those cases (where hasSubtypes(int) is true, special logic must be implemented to retrieve the proper values.


Method Summary
 void fillRelationships(org.hibernate.engine.SessionFactoryImplementor sfi, Map<String,String> value)
          For each of the fields contained in this ExtendedMetadata.Locks object, parse out the type and the field name and store those as the key and value in the "value" argument.
 ome.model.IObject[] getLockCandidates(ome.model.IObject o)
           
 Object getSubtypeValue(int i, int j, Object o)
          uses the ClassMetadata for this ExtendedMetadata.Locks tp retrieve the component value.
 boolean hasSubtypes(int i)
          returns true if this offset points to a field which is an embedded component.
 boolean include(int i)
          returns true if this offset points to a field which may contain an IObject instance
 int numberOfSubtypes(int i)
          returns the number of subtypes for iterating over this secondary array.
 int size()
          the total number of fields for this entity.
 boolean subtypeEquals(int i, int j, String klass)
          returns true is the indexed subtype returns the same class type as the klass argument.
 String subtypeName(int i, int j)
          retrieves the full Hibernate path for this component field.
 int total()
          as opposed to size(), the returns the actual number of fields that will need to be checked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fillRelationships

public void fillRelationships(org.hibernate.engine.SessionFactoryImplementor sfi,
                              Map<String,String> value)
For each of the fields contained in this ExtendedMetadata.Locks object, parse out the type and the field name and store those as the key and value in the "value" argument.


getLockCandidates

public ome.model.IObject[] getLockCandidates(ome.model.IObject o)

size

public int size()
the total number of fields for this entity. The actual number of IObject instances may vary since (1) some fields (like embedded components) can possibly point to multiple instances. See total() for the final size and (2) some fields do not need to be examined (Integers, e.g.). See include


total

public int total()
as opposed to size(), the returns the actual number of fields that will need to be checked.


include

public boolean include(int i)
returns true if this offset points to a field which may contain an IObject instance


hasSubtypes

public boolean hasSubtypes(int i)
returns true if this offset points to a field which is an embedded component.


numberOfSubtypes

public int numberOfSubtypes(int i)
returns the number of subtypes for iterating over this secondary array. If there are no subtypes, this method will return zero. Use hasSubtypes(int) to differentiate the two situations.


getSubtypeValue

public Object getSubtypeValue(int i,
                              int j,
                              Object o)
uses the ClassMetadata for this ExtendedMetadata.Locks tp retrieve the component value.


subtypeEquals

public boolean subtypeEquals(int i,
                             int j,
                             String klass)
returns true is the indexed subtype returns the same class type as the klass argument.


subtypeName

public String subtypeName(int i,
                          int j)
retrieves the full Hibernate path for this component field.



OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

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