Class LazySqlQueryResult
java.lang.Object
org.ametys.plugins.externaldata.data.sql.LazySqlQueryResult
- All Implemented Interfaces:
Iterable<QueryResultRow>,Iterator<QueryResultRow>,QueryResult
SQL query result.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ResultSetThe wrapped ResultSetprotected Query.ResultTypeThe result type. -
Constructor Summary
ConstructorsConstructorDescriptionLazySqlQueryResult(ResultSet resultSet) Constructs a query result around aResultSet. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String>_extractColumnNames(ResultSet resultSet) Extract the column names of a JDBC result set.voidclose()Close and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.Get the column names.intgetSize()Get sizegetType()Get the type of the result.booleanhasNext()iterator()next()voidremove()voidsetType(Query.ResultType resultType) Set the result type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
_resultType
The result type. -
_resultSet
The wrapped ResultSet
-
-
Constructor Details
-
LazySqlQueryResult
Constructs a query result around aResultSet.- Parameters:
resultSet- the result set
-
-
Method Details
-
getType
Description copied from interface:QueryResultGet the type of the result.- Specified by:
getTypein interfaceQueryResult- Returns:
- the result type.
-
getSize
Description copied from interface:QueryResultGet size- Specified by:
getSizein interfaceQueryResult- Returns:
- the size
-
setType
Set the result type.- Parameters:
resultType- the result type.
-
getColumnNames
Description copied from interface:QueryResultGet the column names.- Specified by:
getColumnNamesin interfaceQueryResult- Returns:
- the column names as a Collection.
- Throws:
DataInclusionException- if an error occurs while manipulating the data sources
-
iterator
- Specified by:
iteratorin interfaceIterable<QueryResultRow>
-
hasNext
- Specified by:
hasNextin interfaceIterator<QueryResultRow>
-
next
- Specified by:
nextin interfaceIterator<QueryResultRow>
-
remove
- Specified by:
removein interfaceIterator<QueryResultRow>
-
close
Description copied from interface:QueryResultClose and cleanup the underlying objects and resources (resultset if SQL, LDAP resources...) if needed.- Specified by:
closein interfaceQueryResult
-
_extractColumnNames
Extract the column names of a JDBC result set.- Parameters:
resultSet- the JDBC result set.- Returns:
- the column names as a Collection.
- Throws:
SQLException- if an exception occurs when manipulating the result set
-