SRJRCFrames
v0.1.296

de.schwarzrot.data.transaction
Class TORead<E extends Entity>

java.lang.Object
  extended by de.schwarzrot.data.transaction.support.AbstractTransactionalOperation<E>
      extended by de.schwarzrot.data.transaction.support.AbstractConditionTransactionalOperation<E>
          extended by de.schwarzrot.data.transaction.TORead<E>
Type Parameters:
E - entity of involved instance
All Implemented Interfaces:
TransactionalOperation<E>

public class TORead<E extends Entity>
extends AbstractConditionTransactionalOperation<E>

describes an operation, bound in a transaction, that is used to read persistent instances of given Entity. The optional condition can be used to filter the instances, that should be read.

Author:
Reinhard Mantey

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.schwarzrot.data.transaction.TransactionalOperation
TransactionalOperation.DataDirection
 
Constructor Summary
TORead(Class<E> entityType)
          creates a transaction operation, that reads all persistent instances of the given entityType Result of the read operation can be accessed using getResult()
TORead(Class<E> entityType, Collection<String> propertyNames)
          creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition.
TORead(Class<E> entityType, Collection<String> propertyNames, boolean readUniq)
          creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition.
TORead(Class<E> entityType, ConditionElement arg)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by a single condition element.
TORead(Class<E> entityType, ConditionElement arg, boolean readRelated)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by a single condition element.
TORead(Class<E> entityType, List<ConditionElement> args)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.
TORead(Class<E> entityType, List<ConditionElement> args, boolean readRelated)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.
TORead(Class<E> entityType, List<ConditionElement> args, Collection<String> propertyNames)
          creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition.
TORead(Class<E> entityType, List<ConditionElement> args, int maxRows, boolean readRelated)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.
TORead(E instance)
          creates a transaction operation, that fully populates a partial read Entity instance.
TORead(List<E> result, Class<E> entityType)
          creates a transaction operation, that reads all persistent instances of the given entityType.
TORead(List<E> result, Class<E> entityType, ConditionElement arg)
           
TORead(List<E> result, Class<E> entityType, ConditionElement arg, int maxRows, boolean readRelated)
           
TORead(List<E> result, Class<E> entityType, List<ConditionElement> args)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.
TORead(List<E> result, Class<E> entityType, List<ConditionElement> args, Collection<String> propertyNames, int maxRows, boolean readUniq)
          creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition.
TORead(List<E> result, Class<E> entityType, List<ConditionElement> args, int maxRows, boolean readRelated)
          creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.
 
Method Summary
 void addOrder(String attrName)
           
 void addOrder(String attrName, boolean ascending)
           
 void clearOrderSequence()
           
 int getMaxRows()
           
 Collection<SortInfo> getOrderSequence()
           
 Collection<String> getPropertyNames()
           
 List<E> getResult()
           
 boolean isReadRelated()
           
 boolean isReadUniq()
           
 void setMaxRows(int maxRows)
           
 void setPropertyNames(Collection<String> propertyNames)
           
 void setReadRelated(boolean readRelated)
           
 void setReadUniq(boolean readUniq)
           
 void setResult(List<E> result)
           
 
Methods inherited from class de.schwarzrot.data.transaction.support.AbstractConditionTransactionalOperation
addCondition, clearCondition, getConditionArgs, setConditionArgs
 
Methods inherited from class de.schwarzrot.data.transaction.support.AbstractTransactionalOperation
getDataDirection, getEntityType, getOperationProperty, getResource, getTransaction, setEntityType, setOperationProperty, setResource, setTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TORead

public TORead(Class<E> entityType)
creates a transaction operation, that reads all persistent instances of the given entityType

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read

TORead

public TORead(Class<E> entityType,
              Collection<String> propertyNames)
creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition. Use propertyNames to specify the properties, that should be read. This variant is used to read only small amount of properties of big Entitys mainly for list, where lots of entries should be displayed.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read
propertyNames - the property names, that should get read

TORead

public TORead(Class<E> entityType,
              Collection<String> propertyNames,
              boolean readUniq)
creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition. Use propertyNames to specify the properties, that should be read. This variant is used to read only small amount of properties of big Entitys mainly for list, where lots of entries should be displayed.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read
propertyNames - the property names, that should get read
readUniq - if set to true, the result will contain no duplicates respect to given propertyNames

TORead

public TORead(Class<E> entityType,
              ConditionElement arg)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by a single condition element. Relations will not be resolved.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - - the entity of the instances to read
arg - - the condition that describes the pool of instances

TORead

public TORead(Class<E> entityType,
              ConditionElement arg,
              boolean readRelated)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by a single condition element. Relations will be resolved if parameter readRelated is set to true.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - - the entity of the instances to read
arg - - the condition that describes the pool of instances
readRelated - - flags whether to resolve relations

TORead

public TORead(Class<E> entityType,
              List<ConditionElement> args)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read
args - condition, the instances to read must match

TORead

public TORead(Class<E> entityType,
              List<ConditionElement> args,
              boolean readRelated)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read
args - condition, the instances to read must match
readRelated - - if true, the related instances will be resolved
- if false, they won't be resolved

TORead

public TORead(Class<E> entityType,
              List<ConditionElement> args,
              Collection<String> propertyNames)
creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition. Use propertyNames to specify the properties, that should be read. This variant is used to read only small amount of properties of big Entitys mainly for list, where lots of entries should be displayed.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read
args - condition, the instances to read must match
propertyNames - the property names, that should get read

TORead

public TORead(Class<E> entityType,
              List<ConditionElement> args,
              int maxRows,
              boolean readRelated)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition.

Result of the read operation can be accessed using getResult()

Parameters:
entityType - the type of the instances to read
args - condition, the instances to read must match
maxRows - limit result to maxRows rows - 0 means unlimited result
readRelated - - if true, the related instances will be resolved
- if false, they won't be resolved

TORead

public TORead(E instance)
creates a transaction operation, that fully populates a partial read Entity instance. The given instance must have a valid id, that corresponds to a persistent representation. This variant will also resolve any declared relation.

Parameters:
instance - the instance to reread

TORead

public TORead(List<E> result,
              Class<E> entityType)
creates a transaction operation, that reads all persistent instances of the given entityType. The read instances will be added to the given List. Use this variant to use an already existing lists or use other list types as the internally created ArrayList.

Parameters:
result - the list to get populated by the read instances
entityType - the type of the instances to read

TORead

public TORead(List<E> result,
              Class<E> entityType,
              ConditionElement arg)

TORead

public TORead(List<E> result,
              Class<E> entityType,
              ConditionElement arg,
              int maxRows,
              boolean readRelated)

TORead

public TORead(List<E> result,
              Class<E> entityType,
              List<ConditionElement> args)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition. The read instances will be added to the given List. Use this variant to use an already existing lists or use other list types as the internally created ArrayList.

Parameters:
result - the list to get populated by the read instances
entityType - the type of the instances to read
args - condition, the instances to read must match

TORead

public TORead(List<E> result,
              Class<E> entityType,
              List<ConditionElement> args,
              Collection<String> propertyNames,
              int maxRows,
              boolean readUniq)
creates a transaction operation, that partially reads all persistent instances of the given entityType, filtered by the given condition. Use propertyNames to specify the properties, that should be read. This variant is used to read only small amount of properties of big Entitys mainly for list, where lots of entries should be displayed. The read instances will be added to the given List. Use this variant to use an already existing lists or use other list types as the internally created ArrayList.

Parameters:
result - the list to get populated by the read instances
entityType - the type of the instances to read
args - condition, the instances to read must match
propertyNames - the property names, that should get read
maxRows - limit the result to maxRows - 0 means unlimited result
readUniq - - if true, the related instances will be resolved
- if false, they won't be resolved

TORead

public TORead(List<E> result,
              Class<E> entityType,
              List<ConditionElement> args,
              int maxRows,
              boolean readRelated)
creates a transaction operation, that reads all persistent instances of the given entityType, filtered by the given condition. The read instances will be added to the given List. Use this variant to use an already existing lists or use other list types as the internally created ArrayList.

Parameters:
result - the list to get populated by the read instances
entityType - the type of the instances to read
args - condition, the instances to read must match
maxRows - limit the result to maxRows - 0 means unlimited result
readRelated - - if true, the related instances will be resolved
- if false, they won't be resolved
Method Detail

addOrder

public void addOrder(String attrName)

addOrder

public void addOrder(String attrName,
                     boolean ascending)

clearOrderSequence

public void clearOrderSequence()

getMaxRows

public final int getMaxRows()

getOrderSequence

public final Collection<SortInfo> getOrderSequence()

getPropertyNames

public final Collection<String> getPropertyNames()

getResult

public final List<E> getResult()

isReadRelated

public final boolean isReadRelated()

isReadUniq

public final boolean isReadUniq()

setMaxRows

public final void setMaxRows(int maxRows)

setPropertyNames

public final void setPropertyNames(Collection<String> propertyNames)

setReadRelated

public final void setReadRelated(boolean readRelated)

setReadUniq

public final void setReadUniq(boolean readUniq)

setResult

public final void setResult(List<E> result)

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.