com.flexive.shared.search
Interface FxResultSet

All Known Implementing Classes:
FxEmptyResultSet

public interface FxResultSet

FxSQL result set

Author:
Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Nested Class Summary
static interface FxResultSet.WrappedLock
          A lock with user name information.
 
Method Summary
<T> java.util.List<T>
collectColumn(int columnIndex)
          Projects a single column to a list.
 int getColumnCount()
          Returns the number of columns in this FxResultSet object.
 int getColumnIndex(java.lang.String name)
          Get the index for the given column.
 java.util.Map<java.lang.String,java.lang.Integer> getColumnIndexMap()
          Returns a map returning the column index using the lowercase column name as a key.
 java.lang.String getColumnLabel(int index)
          Returns the column label of the given index in the calling user's language.
 java.lang.String[] getColumnLabels()
          Returns the column labels in the calling user's language.
 java.lang.String getColumnName(int pos)
          Get the designated column's name.
 java.lang.String[] getColumnNames()
          Returns the column names.
 java.util.List<FxFoundType> getContentTypes()
          Returns a list of all content types that are part of the resultset.
 long getCreatedBriefcaseId()
          If the query created a new briefcase, its ID can be retrieved with this method.
 long getCreationTime()
          Returns the time this resultset was created at.
 int getDbSearchTime()
          Returns the time needed to find all matching records in the database.
 int getFetchTime()
          Returns the time needed to find fetch the matching records from the database.
 ResultLocation getLocation()
          Returns the location for which the query was executed.
 int getMaxFetchRows()
          Returns the maximum rows parameter specified with the search.
 java.lang.Object getObject(int rowIndex, int columnIndex)
          Retrieves the value of the designated column in the current row of this FxResultSet object as a Object.
 int getParserExecutionTime()
          Returns the time that was spent parsing the statement.
 int getPrimaryKeyIndex()
          Return the index of the @pk column if it was selected, or -1 otherwise.
 FxResultRow getResultRow(FxPK pk)
          Return a result row wrapper for the given pk, or null if the result row can't be determined.
 FxResultRow getResultRow(int index)
          Return a result row wrapper for the given row number.
 java.lang.Iterable<FxResultRow> getResultRows()
          Return a result row iterator for this result set.
 int getRowCount()
          Returns the number of rows in this FxResultSet object.
 java.util.List<java.lang.Object[]> getRows()
          Returns all rows.
 int getStartIndex()
          Returns the start index specified with the search.
 java.lang.String getString(int rowIndex, int columnIndex)
          Retrieves the value of the designated column in the current row of this FxResultSet object as a String.
 int getTotalRowCount()
          Returns the total row count.
 int getTotalTime()
          Returns the total time spent for the search.
 int getUserWildcardIndex()
          Return the start column index of the properties selected by the user wildcard @*, or -1 if no such wildcard was present in the original statement.
 ResultViewType getViewType()
          Returns the view type for which the query was executed.
 boolean isTruncated()
          Returns true if the found entry set was truncted.
 

Method Detail

getCreationTime

long getCreationTime()
Returns the time this resultset was created at.

Returns:
the creation time of the resultset

getStartIndex

int getStartIndex()
Returns the start index specified with the search.

Returns:
the start index specified with the search

getMaxFetchRows

int getMaxFetchRows()
Returns the maximum rows parameter specified with the search.

Returns:
the maximum rows parameter specified with the search

getColumnNames

java.lang.String[] getColumnNames()
Returns the column names.

Returns:
the column names.

getColumnLabel

java.lang.String getColumnLabel(int index)
                                throws java.lang.ArrayIndexOutOfBoundsException
Returns the column label of the given index in the calling user's language.

Parameters:
index - the column index (first column is 1)
Returns:
the column label of the given index in the calling user's language.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the given position is not valid

getColumnLabels

java.lang.String[] getColumnLabels()
Returns the column labels in the calling user's language.

Returns:
the column labels in the calling user's language.

getRows

java.util.List<java.lang.Object[]> getRows()
Returns all rows.

Returns:
the rows

getColumnName

java.lang.String getColumnName(int pos)
                               throws java.lang.ArrayIndexOutOfBoundsException
Get the designated column's name.

Parameters:
pos - the first column is 1, the second is 2, ...
Returns:
the column name at the given position
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the given position is not valid

getColumnIndex

int getColumnIndex(java.lang.String name)
Get the index for the given column. Returns -1 if the column name does not exist in the result set.

Parameters:
name - the column name
Returns:
the index for the given column name, 1-based

getColumnIndexMap

java.util.Map<java.lang.String,java.lang.Integer> getColumnIndexMap()
Returns a map returning the column index using the lowercase column name as a key.

Returns:
a map returning the column index using the lowercase column name as a key.

getColumnCount

int getColumnCount()
Returns the number of columns in this FxResultSet object.

Returns:
the number of columns

getRowCount

int getRowCount()
Returns the number of rows in this FxResultSet object.

Returns:
the number of rows

getTotalRowCount

int getTotalRowCount()
Returns the total row count.

The total row count is the number of entries found by the search, even if they are not contained in this resultset because of the specified start and end index.

Returns:
the total row count

isTruncated

boolean isTruncated()
Returns true if the found entry set was truncted.

Returns:
true if the result was truncated

getObject

java.lang.Object getObject(int rowIndex,
                           int columnIndex)
                           throws java.lang.ArrayIndexOutOfBoundsException
Retrieves the value of the designated column in the current row of this FxResultSet object as a Object.

Parameters:
rowIndex - - the first row is 1, the second is 2, ...
columnIndex - - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the given row/column combination is out of range

getString

java.lang.String getString(int rowIndex,
                           int columnIndex)
                           throws java.lang.ArrayIndexOutOfBoundsException
Retrieves the value of the designated column in the current row of this FxResultSet object as a String.

Parameters:
rowIndex - - the first row is 1, the second is 2, ...
columnIndex - - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the given row/column combination is out of range

getParserExecutionTime

int getParserExecutionTime()
Returns the time that was spent parsing the statement.

Returns:
the time that was spent parsing the statement

getDbSearchTime

int getDbSearchTime()
Returns the time needed to find all matching records in the database.

Returns:
the time needed to find all matching records in the database

getFetchTime

int getFetchTime()
Returns the time needed to find fetch the matching records from the database.

Returns:
the time needed to find fetch the matching records from the database

getTotalTime

int getTotalTime()
Returns the total time spent for the search.

This time includes the parse time, search time, fetch time and additional programm logic time.

Returns:
the total time spent for the search

getLocation

ResultLocation getLocation()
Returns the location for which the query was executed.

Returns:
the location for which the query was executed.

getViewType

ResultViewType getViewType()
Returns the view type for which the query was executed.

Returns:
the view type for which the query was executed.

getContentTypes

java.util.List<FxFoundType> getContentTypes()
Returns a list of all content types that are part of the resultset.

Items filtered by the parameter CTYPE are also taken into account.

Returns:
a list of all content types that are part of the resultset

getResultRows

java.lang.Iterable<FxResultRow> getResultRows()
Return a result row iterator for this result set.

Returns:
a result row iterator for this result set.

getResultRow

FxResultRow getResultRow(int index)
Return a result row wrapper for the given row number.

Parameters:
index - the row number
Returns:
a result row wrapper for the given row number.

getResultRow

FxResultRow getResultRow(FxPK pk)
Return a result row wrapper for the given pk, or null if the result row can't be determined. (I.e. if "@pk" was not selected).

Parameters:
pk - FxPK
Returns:
a result row wrapper for the given pk, or null if the result row can't be determined.

getCreatedBriefcaseId

long getCreatedBriefcaseId()
If the query created a new briefcase, its ID can be retrieved with this method.

Returns:
the ID of the created briefcase, or -1 if no briefcase was created

collectColumn

<T> java.util.List<T> collectColumn(int columnIndex)
Projects a single column to a list.

Parameters:
columnIndex - the 1-based column index
Returns:
all column values collected in a list

getUserWildcardIndex

int getUserWildcardIndex()
Return the start column index of the properties selected by the user wildcard @*, or -1 if no such wildcard was present in the original statement.

Returns:
the start column index 1-based of the properties selected by the user wildcard @*, or -1 if no such wildcard was present in the original statement.

getPrimaryKeyIndex

int getPrimaryKeyIndex()
Return the index of the @pk column if it was selected, or -1 otherwise.

Returns:
the index of the @pk column if it was selected, or -1 otherwise.
Since:
3.1