ome.api
Interface IUpdate

All Superinterfaces:
ServiceInterface
All Known Subinterfaces:
LocalUpdate
All Known Implementing Classes:
UpdateImpl

public interface IUpdate
extends ServiceInterface

Provides methods for directly updating object graphs. IUpdate is the lowest level (level-1) interface which may make changes (INSERT, UPDATE, DELETE) to the database. All other methods of changing the database may leave it in an inconsistent state.

All the save* methods act recursively on the entire object graph, replacing placeholders and details where necessary, and then "merging" the final graph. This means that the objects that are passed into IUpdate.save* methods are copied over to new instances which are then returned. The original objects should be discarded.

saveAndReturnIds(IObject[]) behaves slightly differently in that it does not handle object modifications. The graph of objects passed in can consist ONLY if either newly created objects without ids or of unloaded objects with ids. Note: The ids of the saved values may not be in order. This is caused by persistence-by-transitivity. Hibernate may detect an item later in the array if they are interconnected and therefore choose to save it first.

All methods throw ValidationException if the input objects do not pass validation, and OptimisticLockException if the version of a given has already been incremented.

Since:
OMERO3.0
Version:
3.0 (Internal version: $Revision$ $Date$)
Author:

Josh Moore      josh.moore@gmx.de
See Also:
Validation, UpdateImpl, Details

Method Summary
 void deleteObject(ome.model.IObject row)
          Deletes a single entity.
 void indexObject(ome.model.IObject row)
          Initiates full-text indexing for the given object.
 ome.model.IObject[] saveAndReturnArray(ome.model.IObject[] graph)
           
 List<Long> saveAndReturnIds(ome.model.IObject[] objects)
          Logic differs from other methods.
<T extends ome.model.IObject>
T
saveAndReturnObject(T graph)
           
 void saveArray(ome.model.IObject[] graph)
           
 void saveCollection(Collection<ome.model.IObject> graph)
           
 void saveObject(ome.model.IObject graph)
           
 

Method Detail

saveAndReturnIds

List<Long> saveAndReturnIds(ome.model.IObject[] objects)
Logic differs from other methods. See class description

See Also:
IUpdate

saveCollection

void saveCollection(Collection<ome.model.IObject> graph)
See Also:
IUpdate

saveObject

void saveObject(ome.model.IObject graph)
See Also:
IUpdate

saveArray

void saveArray(ome.model.IObject[] graph)
See Also:
IUpdate

saveAndReturnObject

<T extends ome.model.IObject> T saveAndReturnObject(T graph)
See Also:
IUpdate

saveAndReturnArray

ome.model.IObject[] saveAndReturnArray(ome.model.IObject[] graph)
See Also:
IUpdate

deleteObject

void deleteObject(ome.model.IObject row)
                  throws ome.conditions.ValidationException
Deletes a single entity. Unlike the other IUpdate methods, deleteObject does not propagate to related entities (e.g. foreign key relationships) and so calls to deleteObject must be properly ordered.

Parameters:
row - a persistent {@link IObject{ to be deleted.
Throws:
ome.conditions.ValidationException - if the row is locked, has foreign key constraints, or is otherwise marked un-deletable.

indexObject

void indexObject(ome.model.IObject row)
                 throws ome.conditions.ValidationException
Initiates full-text indexing for the given object. This may have to wait for the current FullTextThread to finish. Can only be executed by an admin. Other users must wait for the background Thread to complete.

Parameters:
row - a persistent IObject to be deleted
Throws:
ome.conditions.ValidationException - if the object does not exist or is nul


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

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