org.apache.empire.data.bean
Class BeanResult<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by org.apache.empire.data.bean.BeanResult<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess

public class BeanResult<T>
extends ArrayList<T>

BeanResult This is a simple helper class that performs reading a list of beans from a query Internally DBReader.getBeanList() is used.

Author:
doebele
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BeanResult(Class<T> clazz, DBCommand cmd)
          Create a bean result from a command object.
BeanResult(Class<T> clazz, DBRowSet rowset)
          Creates a bean result for a Table, View or Query from the supplied columns.
 
Method Summary
 int fetch(Connection conn)
           
 int fetch(Connection conn, int maxItems)
           
 DBCommand getCommand()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

BeanResult

public BeanResult(Class<T> clazz,
                  DBCommand cmd)
Create a bean result from a command object. No checks will be performed here whether the command is compatible with the supplied class.

Parameters:
clazz -
cmd -

BeanResult

public BeanResult(Class<T> clazz,
                  DBRowSet rowset)
Creates a bean result for a Table, View or Query from the supplied columns. At least one column must match the given getters / setters on the supplied class otherwise an BeanIncompatibleException will be thrown.

Parameters:
clazz - the of T
rowset - the rowset
Method Detail

getCommand

public DBCommand getCommand()

fetch

public int fetch(Connection conn,
                 int maxItems)

fetch

public final int fetch(Connection conn)


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.