ome.tools.hibernate
Class UpdateFilter

java.lang.Object
  extended by ome.util.ContextFilter
      extended by ome.tools.hibernate.UpdateFilter
All Implemented Interfaces:
ome.util.Filter
Direct Known Subclasses:
ReloadFilter

public class UpdateFilter
extends ome.util.ContextFilter

responsible for correlating entity identities during multiple calls to merge. This occurs when collections or arrays are passed into the UpdateImpl save methods.

Since:
3.0-M3
Version:
$Revision$, $Date$
Author:
Josh Moore, josh.moore at gmx.de
See Also:
IUpdate, UpdateImpl

Field Summary
 
Fields inherited from class ome.util.ContextFilter
_cache, _context
 
Constructor Summary
UpdateFilter()
           
 
Method Summary
protected  boolean alreadySeen(Object o)
           
 Collection filter(String fieldId, Collection c)
          overrides ContextFilter.filter(String, Collection) to return previously checked collections.
 ome.util.Filterable filter(String fieldId, ome.util.Filterable f)
          overrides ContextFilter.filter(String, Filterable) to return previously merged or previously checked items.
 Map filter(String fieldId, Map m)
          Prevents CountPerOwner from being loaded unnecessarily.
 Object filter(String fieldId, Object o)
          overrides ContextFilter.filter(String, Object) to allow only certain types to enter the Hibernate system
protected  boolean hasReplacement(Object o)
           
protected  Object returnSeen(Object o)
           
 void unloadReplacedObjects()
          provides an external hook to unload all files which have already been merged.
 
Methods inherited from class ome.util.ContextFilter
addSeen, afterFilter, beforeFilter, currentContext, doFilter, doFilter, doFilter, enter, exit, filter, hasntSeen, pop, previousContext, push
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateFilter

public UpdateFilter()
Method Detail

unloadReplacedObjects

public void unloadReplacedObjects()
provides an external hook to unload all files which have already been merged.

Merging produces a copy of an entity, so that all old entities should be considered stale. By unloading them, one is forcing the API user to use the replacement instead.

The replacement is set by MergeEventListener and this is the signal that that entity can be unloaded. Usually, this method is invoked by UpdateImpl

See Also:
MergeEventListener, UpdateImpl, IObject.unload()

filter

public Object filter(String fieldId,
                     Object o)
overrides ContextFilter.filter(String, Object) to allow only certain types to enter the Hibernate system

Specified by:
filter in interface ome.util.Filter
Overrides:
filter in class ome.util.ContextFilter

filter

public ome.util.Filterable filter(String fieldId,
                                  ome.util.Filterable f)
overrides ContextFilter.filter(String, Filterable) to return previously merged or previously checked items.

Specified by:
filter in interface ome.util.Filter
Overrides:
filter in class ome.util.ContextFilter

filter

public Collection filter(String fieldId,
                         Collection c)
overrides ContextFilter.filter(String, Collection) to return previously checked collections.

Specified by:
filter in interface ome.util.Filter
Overrides:
filter in class ome.util.ContextFilter

filter

public Map filter(String fieldId,
                  Map m)
Prevents CountPerOwner from being loaded unnecessarily.

Specified by:
filter in interface ome.util.Filter
Overrides:
filter in class ome.util.ContextFilter
See Also:
ticket:3978

hasReplacement

protected boolean hasReplacement(Object o)

alreadySeen

protected boolean alreadySeen(Object o)

returnSeen

protected Object returnSeen(Object o)


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

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