62 lines
3.3 KiB
Java
62 lines
3.3 KiB
Java
package com.foundation.controller;
|
|
|
|
import com.common.util.IList;
|
|
import com.foundation.attribute.IReflectable;
|
|
import com.foundation.attribute.IReflectableCollection;
|
|
import com.foundation.common.IEntity;
|
|
import com.foundation.transaction.ReadTransaction;
|
|
|
|
/**
|
|
* Manages models on a single process and maintains a map of models currently loaded into memory.
|
|
* This should be used for large collections of shared models where a small number will be loaded at any given time.
|
|
*/
|
|
public interface ISingleMappedModelManager extends IModelManager {
|
|
/**
|
|
* Adds the entity to the shared set of models and to any attached repository.
|
|
* @param entity The entity to be added. This object must be serializable in the event that the model management occurs on a remote process.
|
|
* @param returnAddition Whether to return the added value.
|
|
* @return The result of the add operation.
|
|
*/
|
|
public ReflectionResult addEntity(IEntity entity, boolean returnAddition);
|
|
/**
|
|
* Adds the entities to the shared set of models and to any attached repository.
|
|
* @param entities The entities to be added. This object must be serializable in the event that the model management occurs on a remote process.
|
|
* @param returnAdditions Whether to return the added values.
|
|
* @return The result of the add operation.
|
|
*/
|
|
public ReflectionResult addEntities(IList entities, boolean returnAdditions);
|
|
/**
|
|
* Removes (deletes) the entity from the shared set of models and from any attached repository.
|
|
* @param entity The entity to be removed. This object must be serializable in the event that the model management occurs on a remote process.
|
|
*/
|
|
public ReflectionResult removeEntity(IEntity entity);
|
|
/**
|
|
* Removes (deletes) the entities from the shared set of models and from any attached repository.
|
|
* @param entities The collection of IReflectable instances to be removed. This object must be serializable in the event that the model management occurs on a remote process.
|
|
*/
|
|
public ReflectionResult removeEntities(IList entities);
|
|
/**
|
|
* Finds the first entity matching the query.
|
|
* @param query The query by example object.
|
|
* @return The IReflectable instance of the first result.
|
|
*/
|
|
public ReflectionResult findEntity(IEntity query);
|
|
/**
|
|
* Finds all entities matching the query.
|
|
* @param query The query by example object.
|
|
* @return The collection of IReflectable instances matching the query. Will never be null.
|
|
*/
|
|
public ReflectionResult findEntities(IEntity query);
|
|
/**
|
|
* Gets all the entities matching the given query.
|
|
* @param transaction The transaction that will be run to produce entities which will be used to find the shared entities. This is similar to getEntities(Object[] keys), except that the caller doesn't have to perform as much work (it will be performed in the manager). <b>This transaction MUST query for all key attributes in the entity (those marked in the class as AO_KEY when defined).</b>
|
|
* @return The IReflectable instance of the first result.
|
|
*/
|
|
public ReflectionResult findEntities(ReadTransaction transaction);
|
|
/**
|
|
* Gets all the entities for the given set of keys.
|
|
* @param keys The keys for the entities desired. These can be obtained by calling IEntity.entityGetKey().
|
|
* @return The IReflectable instance of the first result.
|
|
*/
|
|
public ReflectionResult findEntities(Object[] keys);
|
|
}//ISingleMappedModelListener// |