Interface TargetList

All Superinterfaces:
Collection<Attribute>, Iterable<Attribute>, List<Attribute>, SequencedCollection<Attribute>
All Known Subinterfaces:
TargetList.Projection, TupleDescriptor, TupleDescriptor.Ephemeral, TupleDescriptor.Interned

public interface TargetList extends List<Attribute>
Identifies attributes to be retrieved from a set of tuples.

TargetList is more general than Projection: in a Projection, no attribute can appear more than once, but repetition is possible in a TargetList.

In general, it will be more efficient, if processing logic requires more than one copy of some attribute's value, to simply mention the attribute once in a Projection, and have the Java logic then copy the value, rather than fetching and converting it twice from the database native form. But there may be cases where that isn't workable, such as when the value is needed in different Java representations from different Adapters, or when the Java representation is a type like SQLXML that can only be used once. Such cases call for a TargetList in which the attribute is mentioned more than once, to be separately fetched.

Given a TargetList, query results can be processed by supplying a lambda body to applyOver. The lambda will be supplied a Cursor whose apply methods can be used to break out the wanted values on each row, in the TargetList order.