- java.lang.Object
-
- org.eclipse.persistence.queries.ReportQueryResult
-
- All Implemented Interfaces:
Serializable
,Map
public class ReportQueryResult extends Object implements Serializable, Map
Purpose: A single row (type) result for a ReportQueryDescription: Represents a single row of attribute values (converted using mapping) for a ReportQuery. The attributes can be from various objects. Responsibilities:
- Converted field values into object attribute values.
- Provide access to values by index or item name
- See Also:
- Serialized Form
- Author:
- Doug Clarke
- Since:
- TOPLink/Java 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ReportQueryResult.EntryIterator
Defines the virtual entrySet iterator.protected class
ReportQueryResult.EntrySet
Defines the virtual entrySet.protected class
ReportQueryResult.KeyIterator
Defines the virtual keySet iterator.protected class
ReportQueryResult.KeySet
Defines the virtual keySet.protected static class
ReportQueryResult.RecordEntry
Entry class for implementing Map interface.
-
Field Summary
Fields Modifier and Type Field Description protected StringBuffer
key
If an objectLevel distinct is used then generate unique key for this resultprotected List<String>
names
Item names to lookup result valuesprotected Object
primaryKey
Id value if the retrievPKs flag was set on the ReportQuery.protected List<Object>
results
Actual converted attribute values
-
Constructor Summary
Constructors Constructor Description ReportQueryResult(List<Object> results, Object primaryKeyValues)
INTERNAL: Used to create test resultsReportQueryResult(ReportQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyResults)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildResult(ReportQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyData)
INTERNAL: Create an array of attribute values (converted from raw field values using the mapping).void
clear()
PUBLIC: Clear the contents of the result.boolean
contains(Object value)
PUBLIC: Check if the value is contained in the result.boolean
containsKey(Object key)
PUBLIC: Check if the key is contained in the result.boolean
containsValue(Object value)
PUBLIC: Check if the value is contained in the result.Set
entrySet()
PUBLIC: Returns a set of the keys.boolean
equals(Object anObject)
PUBLIC: Compare if the two results are equal.boolean
equals(ReportQueryResult result)
INTERNAL: Used in testing to compare if results are correct.Object
get(Object name)
PUBLIC: Return the value for given item name.Object
get(String name)
PUBLIC: Return the value for given item name.Object
getByIndex(int index)
PUBLIC: Return the indexed value from result.Object
getId()
PUBLIC: Return the Id for the result or null if not requested.List<String>
getNames()
PUBLIC: Return the names of report items, provided to ReportQuery.String
getResultKey()
INTERNAL: Return the unique key for this resultList<Object>
getResults()
PUBLIC: Return the results.int
hashCode()
boolean
isEmpty()
PUBLIC: Return if the result is empty.Set
keySet()
PUBLIC: Returns a set of the keys.protected Object
processItem(ReportQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyData, org.eclipse.persistence.internal.queries.ReportItem item)
INTERNAL: Return a value from an item and database row (converted from raw field values using the mapping).Object
put(Object name, Object value)
ADVANCED: Set the value for given item name.void
putAll(Map map)
PUBLIC: Add all of the elements.Object
readObject(Class<?> javaClass, Session session)
PUBLIC: If the PKs were retrieved with the attributes then this method can be used to read the real object from the database.Object
remove(Object name)
INTERNAL: Remove the name key and value from the result.protected void
setId(Object primaryKey)
INTERNAL: Set the Id for the result row's object.protected void
setNames(List<String> names)
void
setResults(List<Object> results)
INTERNAL: Set the results.int
size()
PUBLIC: Return the number of name/value pairs in the result.Object[]
toArray()
INTERNAL: Converts the ReportQueryResult to a simple array of values.List
toList()
INTERNAL: Converts the ReportQueryResult to a simple list of values.String
toString()
Collection
values()
PUBLIC: Returns an collection of the values.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
primaryKey
protected Object primaryKey
Id value if the retrievPKs flag was set on the ReportQuery. These can be used to get the actual object
-
key
protected StringBuffer key
If an objectLevel distinct is used then generate unique key for this result
-
-
Constructor Detail
-
ReportQueryResult
public ReportQueryResult(List<Object> results, Object primaryKeyValues)
INTERNAL: Used to create test results
-
ReportQueryResult
public ReportQueryResult(ReportQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyResults)
-
-
Method Detail
-
buildResult
protected void buildResult(ReportQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyData)
INTERNAL: Create an array of attribute values (converted from raw field values using the mapping).
-
processItem
protected Object processItem(ReportQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyData, org.eclipse.persistence.internal.queries.ReportItem item)
INTERNAL: Return a value from an item and database row (converted from raw field values using the mapping).
-
clear
public void clear()
PUBLIC: Clear the contents of the result.
-
contains
public boolean contains(Object value)
PUBLIC: Check if the value is contained in the result.
-
containsKey
public boolean containsKey(Object key)
PUBLIC: Check if the key is contained in the result.- Specified by:
containsKey
in interfaceMap
-
containsValue
public boolean containsValue(Object value)
PUBLIC: Check if the value is contained in the result.- Specified by:
containsValue
in interfaceMap
-
entrySet
public Set entrySet()
PUBLIC: Returns a set of the keys.
-
equals
public boolean equals(Object anObject)
PUBLIC: Compare if the two results are equal.
-
equals
public boolean equals(ReportQueryResult result)
INTERNAL: Used in testing to compare if results are correct.
-
hashCode
public int hashCode()
-
getByIndex
public Object getByIndex(int index)
PUBLIC: Return the indexed value from result.
-
getResultKey
public String getResultKey()
INTERNAL: Return the unique key for this result
-
getNames
public List<String> getNames()
PUBLIC: Return the names of report items, provided to ReportQuery.
-
getId
public Object getId()
PUBLIC: Return the Id for the result or null if not requested.
-
isEmpty
public boolean isEmpty()
PUBLIC: Return if the result is empty.
-
putAll
public void putAll(Map map)
PUBLIC: Add all of the elements.
-
readObject
public Object readObject(Class<?> javaClass, Session session)
PUBLIC: If the PKs were retrieved with the attributes then this method can be used to read the real object from the database.
-
setId
protected void setId(Object primaryKey)
INTERNAL: Set the Id for the result row's object.
-
size
public int size()
PUBLIC: Return the number of name/value pairs in the result.
-
toArray
public Object[] toArray()
INTERNAL: Converts the ReportQueryResult to a simple array of values.
-
toList
public List toList()
INTERNAL: Converts the ReportQueryResult to a simple list of values.
-
values
public Collection values()
PUBLIC: Returns an collection of the values.
-
-