Package org.compiere.model
Class POResultSet<T extends PO>
java.lang.Object
org.compiere.model.POResultSet<T>
- All Implemented Interfaces:
AutoCloseable
Simple wrapper over JDBC result set
- Author:
- Low Heng Sin, Teo Sarca, SC ARHIPAC SERVICE SRL
- FR [ 1984834 ] Add POResultSet.hasNext convenient method
- FR [ 1985134 ] POResultSet improvements
-
Constructor Summary
ConstructorDescriptionPOResultSet
(MTable table, PreparedStatement ps, ResultSet rs, String trxName) Constructs the POResultSet.
By default, closeOnError option is false. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Release database resources.boolean
hasNext()
Is result set has next recordboolean
Will thePreparedStatement
andResultSet
closed on any database exceptionnext()
Get next recordvoid
setCloseOnError
(boolean closeOnError) Should we automatically close thePreparedStatement
andResultSet
in case we get an error.void
setSelectColumns
(String[] selectColumns) Set columns for result set.
-
Constructor Details
-
POResultSet
Constructs the POResultSet.
By default, closeOnError option is false. You need to set it explicitly.- Parameters:
table
-ps
-rs
-trxName
-
-
-
Method Details
-
hasNext
Is result set has next record- Returns:
- true if it has next, false otherwise
- Throws:
DBException
-
next
Get next record- Returns:
- PO or null if reach the end of result set
- Throws:
DBException
-
setCloseOnError
public void setCloseOnError(boolean closeOnError) Should we automatically close thePreparedStatement
andResultSet
in case we get an error.- Parameters:
closeOnError
-
-
isCloseOnError
public boolean isCloseOnError()Will thePreparedStatement
andResultSet
closed on any database exception- Returns:
- true if yes, false otherwise
-
close
public void close()Release database resources.- Specified by:
close
in interfaceAutoCloseable
-
setSelectColumns
Set columns for result set. Use for loading of partial PO.- Parameters:
selectColumns
-
-