Documentation Home
X DevAPI User Guide
Download this Manual

X DevAPI User Guide  /  Working with Result Sets  /  Result Set Classes

9.1 Result Set Classes

All database operations return a result. The type of result returned depends on the operation which was executed. The different types of results returned are outlined in the following table.

Result Class

Returned By

Provides

Result

add().execute(), insert().execute(), ...

affectedRows, lastInsertId, warnings

SqlResult

session.runSql()

affectedRows, lastInsertId, warnings, fetched data sets

DocResult

find().execute()

fetched data set

RowResult

select.execute()

fetched data set

The following class diagram gives a basic overview of the result handling.

Figure 9.1 Results - Class Diagram

In the following functions, square brackets indicate a list of items. This can be any appropriate list type in the target language (an array, a collection, and so on). The BaseResults class contains the following functions: getWarningsCount(): int and getWarnings(): Warning[]. which are diagnostics functions. The Result class contains the following functions: getAffectedItemsCount(): int, getLastInsertID(): int, and getLastDocumentID(): UUID_String, which are data change information functions. The DocResult class contains the following functions: fetchOne(): DbDoc and fetchAll(): DbDoc[], which are document access functions. The RowResult class contains the following functions: fetchOne(): Row and fetchAll(): Row[], which are row access functions. getColumnCount(): int, getColumns(): Column[], and getColumnNames(): String[]. which are column access functions. The SqlResult class contains the following functions: getAffectedRowsCount(): int, getLastInsertId(): int, hasData(): boolean, and nextResult(): boolean. The last function returns multiple data sets.


User Comments
Sign Up Login You must be logged in to post a comment.