1 JSResultSet

Class deister.axional.script.lib.ax.rs.JSResultSet


A Wrapper of ResultSet (either JDBCResultSet or SQLResultSet)

Constructor Summary

MethodDescription
JSResultSet(JSConnection conn, T rs)
JSResultSet(T rs)

Method Summary

Modifier and TypeMethodDescription
ResultSet __toResultSet(Object arg0)
String asJSON()
void asJSON(Consumer<JSONExportOptions> arg0)
void beforeFirst()
void close()var rs = Ax.
boolean closeIfNeed(String cause)
ISQLResultSetCols cols()
ResultSetComparator compare(IResultSetConvertible arg0)
ResultSetComparator compare(IResultSetConvertible arg0, double arg1)
ResultSetCursorGroup cursor()
boolean equals(IResultSetConvertible arg0)
boolean equals(IResultSetConvertible arg0, double arg1)
int findColumn(String columnName)
ResultSetRowMap firstOne()Like toOne but will not fail if more than one row.
Object getAttribute(String name)
String getColumnLocalizedValue(String lang, int columnIndex)
String getColumnLocalizedValue(LocaleFormatter formater, int columnIndex)
String getColumnLocalizedValue(JSLocaleFormatter formater, int columnIndex)
String getColumnType(String colname)
JSConnection getConnection()
ExtendedResultSetMetaData getMetaData()
int getObjectId()
int getParentId()
int getRow()
int getRowCount()
String getSQL()
String getTitle()
boolean isColumnNullable(String colname)
boolean isColumnNumeric(int arg0)
boolean isMemory()
boolean isResultSet(Object arg0)
Iterator iterator()
String ltrim(String arg0)
boolean next()
SQLResultSetArray pivot(Consumer<ResultSetPivotOptions> config)
boolean previous()
ISQLResultSetRows rows()
String rtrim(String arg0)
void setAttribute(String name, Object value)
ResultSet setTitle(String title)
ResultSetTupleStream stream()
List toArray()Returns the resultSet as a Java array (array of arrays)
List toArray(String columnName)Same as toArray() but for a single column so it will return the column only
List toArray(ResultSet arg0)
List toArray(ResultSet arg0, String arg1)
String toCSV()
void toCSV(Consumer<CSVExportOptions> arg0)
byte[] toExcel()
void toExcel(Consumer<ExcelExportOptions> arg0)
String toFOP()
String toFOP(Consumer<FOPReportConfig> arg0)
String toFOPTableBody(double arg0)
String toFOPTableBody(Consumer<FOPReportConfig> arg0, double arg1)
String toHTML()
String toHTML(Consumer<HtmlConfigurator> arg0)
String toJSON()
String toJSON(Consumer<JSONConfigurator> arg0)
List toJSONArray()Same as toOne() we should return a JSON array (at least immutable)
List toJSONArray(ResultSet arg0)
String toJavaScript()
SQLResultSetArray toMemory()
ResultSetRowMap toOne()
byte[] toPDF()
byte[] toPDF(Consumer<FOPReportConfig> arg0)
byte[] toPDF(String arg0)
ResultSet toResultSet()
ResultSet toResultSet(Object arg0)
ResultSetRowMap toRow()
JDBCSQLCA toSQLCA(Object arg0)
String toString()Allow print(db.
String toText()
String toText(Consumer<ResultSetPrinterConfig> arg0)
Object toValue()
Object toValue(ResultSet arg0)
byte[] toXLS()
byte[] toXLSX()
String trimNull(String arg0)

Method Detail

JSResultSet

 JSResultSet(JSConnection conn, T rs)
Parameters:
conn - 
rs - 

JSResultSet

 JSResultSet(T rs)
Parameters:
rs - 

__toResultSet

                        ResultSet __toResultSet(Object arg0)
Parameters:
arg0 - 
Returns:

asJSON

                        String asJSON()
Returns:

asJSON

void asJSON(Consumer<JSONExportOptions> arg0)
Parameters:
arg0 - 

beforeFirst

void beforeFirst()

close

void close()
Info:
var rs = Ax.db.executeQuery("SELECT .."); rs.close();

closeIfNeed

boolean closeIfNeed(String cause)
Parameters:
cause - 
Returns:

cols

                        ISQLResultSetCols cols()
Returns:

compare

                        ResultSetComparator compare(IResultSetConvertible arg0)
Parameters:
arg0 - 
Returns:

compare

                        ResultSetComparator compare(IResultSetConvertible arg0, double arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

cursor

                        ResultSetCursorGroup cursor()
Returns:

equals

boolean equals(IResultSetConvertible arg0)
Parameters:
arg0 - 
Returns:

equals

boolean equals(IResultSetConvertible arg0, double arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

findColumn

int findColumn(String columnName)
Parameters:
columnName - 
Returns:

firstOne

                        ResultSetRowMap firstOne()
Info:
Like toOne but will not fail if more than one row. It's like SQL SELECT FIRST 1
Returns:

getAttribute

                        Object getAttribute(String name)
Parameters:
name - 
Returns:

getColumnLocalizedValue

                        String getColumnLocalizedValue(String lang, int columnIndex)
Parameters:
lang - 
columnIndex - 
Returns:

getColumnLocalizedValue

                        String getColumnLocalizedValue(LocaleFormatter formater, int columnIndex)
Parameters:
formater - 
columnIndex - 
Returns:

getColumnLocalizedValue

                        String getColumnLocalizedValue(JSLocaleFormatter formater, int columnIndex)
Parameters:
formater - 
columnIndex - 
Returns:

getColumnType

                        String getColumnType(String colname)
Parameters:
colname - 
Returns:
a human readable version of column type (useful to determine data type)

getConnection

                        JSConnection getConnection()
Returns:

getMetaData

                        ExtendedResultSetMetaData getMetaData()
Returns:

getObjectId

int getObjectId()
Returns:

getParentId

int getParentId()
Returns:

getRow

int getRow()
Returns:

getRowCount

int getRowCount()
Returns:
the number of rows loaded in memory ResultSet or -1 if it's unknown (cause it's a JDBC ResultSet)

getSQL

                        String getSQL()
Returns:

getTitle

                        String getTitle()
Returns:

isColumnNullable

boolean isColumnNullable(String colname)
Parameters:
colname - 
Returns:

isColumnNumeric

boolean isColumnNumeric(int arg0)
Parameters:
arg0 - 
Returns:

isMemory

boolean isMemory()
Returns:

isResultSet

boolean isResultSet(Object arg0)
Parameters:
arg0 - 
Returns:

iterator

                        Iterator iterator()
Returns:

ltrim

                        String ltrim(String arg0)
Parameters:
arg0 - 
Returns:

next

boolean next()
Returns:

pivot

                        SQLResultSetArray pivot(Consumer<ResultSetPivotOptions> config)
Parameters:
config - 
Returns:

previous

boolean previous()
Returns:

rows

                        ISQLResultSetRows rows()
Returns:

rtrim

                        String rtrim(String arg0)
Parameters:
arg0 - 
Returns:

setAttribute

void setAttribute(String name, Object value)
Parameters:
name - 
value - 

setTitle

                        ResultSet setTitle(String title)
Parameters:
title - 
Returns:

stream

                        ResultSetTupleStream stream()
Returns:

toArray

                        List toArray()
Info:
Returns the resultSet as a Java array (array of arrays)
Returns:

toArray

                        List toArray(String columnName)
Info:
Same as toArray() but for a single column so it will return the column only
Parameters:
columnName - 
Returns:
the resultSet as a List of column content

toArray

                        List toArray(ResultSet arg0)
Parameters:
arg0 - 
Returns:

toArray

                        List toArray(ResultSet arg0, String arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

toCSV

                        String toCSV()
Returns:

toCSV

void toCSV(Consumer<CSVExportOptions> arg0)
Parameters:
arg0 - 

toExcel

byte[] toExcel()
Returns:

toExcel

void toExcel(Consumer<ExcelExportOptions> arg0)
Parameters:
arg0 - 

toFOP

                        String toFOP()
Returns:

toFOP

                        String toFOP(Consumer<FOPReportConfig> arg0)
Parameters:
arg0 - 
Returns:

toFOPTableBody

                        String toFOPTableBody(double arg0)
Parameters:
arg0 - 
Returns:

toFOPTableBody

                        String toFOPTableBody(Consumer<FOPReportConfig> arg0, double arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

toHTML

                        String toHTML()
Returns:

toHTML

                        String toHTML(Consumer<HtmlConfigurator> arg0)
Parameters:
arg0 - 
Returns:

toJSON

                        String toJSON()
Returns:
a JSON in a format that is convertible back to a ResultSet

toJSON

                        String toJSON(Consumer<JSONConfigurator> arg0)
Parameters:
arg0 - 
Returns:

toJSONArray

                        List toJSONArray()
Info:
Same as toOne() we should return a JSON array (at least immutable)
Returns:
the resultSet as a List of JSON rows

toJSONArray

                        List toJSONArray(ResultSet arg0)
Parameters:
arg0 - 
Returns:

toJavaScript

                        String toJavaScript()
Returns:

toMemory

                        SQLResultSetArray toMemory()
Returns:
a JSResultSet wrapping a memory SQLResultSetArray so it can be iterated many times.

toOne

                        ResultSetRowMap toOne()
Returns:
the current row as JSON map fetching it and ensuring no more rows exists. We return a JSObject instead of ResultSetRowMap cause even Nashorn hanles perfectly the Map in javascript, if we want to compose a JSON object using this as element it will not really be composed of JSONs. The case comes when we want to send a composed JSON object combining various JSONs and JSON arrays. var json = { invoice : Ax.db.executeQuery("SELECT invoiceNumber, invocieDate as date, total FROM invoice WHERE invoiceNumber = ?", number).toOne(), company : Ax.db.executeQuery("SELECT * FROM company where company_id = (SELECT company_id FROM invoice WHERE invoiceNumber = ?)", number).toOne(), items : Ax.db.executeQuery("SELECT * FROM items WHERE invoiceNumber = ? ORDER BY seqno", number).toArray() } Even this object can be handled by Nashorn, if we build it using ResultSetRowMap for invoice an company and and List <ResultSetRowMap> for items, it is not really composed of JSON objects. If not rows, the map contains the keys with null values

toPDF

byte[] toPDF()
Returns:

toPDF

byte[] toPDF(Consumer<FOPReportConfig> arg0)
Parameters:
arg0 - 
Returns:

toPDF

byte[] toPDF(String arg0)
Parameters:
arg0 - 
Returns:

toResultSet

                        ResultSet toResultSet()
Returns:

toResultSet

                        ResultSet toResultSet(Object arg0)
Parameters:
arg0 - 
Returns:

toRow

                        ResultSetRowMap toRow()
Returns:

toSQLCA

                        JDBCSQLCA toSQLCA(Object arg0)
Parameters:
arg0 - 
Returns:

toString

                        String toString()
Info:
Allow print(db.executeQuery(...));
Returns:

toText

                        String toText()
Returns:

toText

                        String toText(Consumer<ResultSetPrinterConfig> arg0)
Parameters:
arg0 - 
Returns:

toValue

                        Object toValue()
Returns:
a single column on a single row resultset

toValue

                        Object toValue(ResultSet arg0)
Parameters:
arg0 - 
Returns:

toXLS

byte[] toXLS()
Returns:

toXLSX

byte[] toXLSX()
Returns:

trimNull

                        String trimNull(String arg0)
Parameters:
arg0 - 
Returns:

2 Report

Class Ax.rs.Report


Wrapper of ResultSetCursorReport

Constructor Summary

MethodDescription
JSResultSetCursorReport(JSResultSet rs)Create an instance of ResultSetCursorReport based on given rs
JSResultSetCursorReport(SQLResultSetArray rs)Create a report from a memory resultset

Method Summary

Modifier and TypeMethodDescription
ResultSet __toResultSet(Object arg0)
String asJSON()
void asJSON(Consumer<JSONExportOptions> arg0)
void close()Ensure the ResulSet is closed.
ResultSetComparator compare(IResultSetConvertible arg0)
ResultSetComparator compare(IResultSetConvertible arg0, double arg1)
ResultSetCursorGroup cursor()
boolean equals(IResultSetConvertible arg0)
boolean equals(IResultSetConvertible arg0, double arg1)
JSResultSet getJSResultSet()
SQLResultSetMetaData getMetaData()
boolean isResultSet(Object arg0)
Iterator iterator()
JSResultSetCursorReport setAccumulated(String name)
JSResultSetCursorReport setAvoidSingleRowTotals(boolean collapse)
JSResultSetCursorReport setCollapseTotals(boolean collapse)
JSResultSetCursorReport setExpression(String name, String expression)
ColumnGroup setGroupBy(String[] columnNames)
JSResultSetCursorReport setHeader(int columnIndex, String headerLabel)
ColumnTotal setTotalBy(String name)Set a default (SUM) General total by given column
ColumnTotal setTotalBy(String name, String[] statistics)Set a General totals by given column
ColumnTotal setTotalByExpression(String name, String expression)
ResultSetTupleStream stream()
String toCSV()
void toCSV(Consumer<CSVExportOptions> arg0)
byte[] toExcel()
void toExcel(Consumer<ExcelExportOptions> arg0)
String toFOP()
String toFOP(Consumer<FOPReportConfig> arg0)
String toFOPTableBody(double arg0)
String toFOPTableBody(Consumer<FOPReportConfig> arg0, double arg1)
String toHTML()
String toHTML(Consumer<HtmlConfigurator> arg0)
String toJSON()
String toJSON(Consumer<JSONConfigurator> arg0)
String toJavaScript()
byte[] toPDF()
byte[] toPDF(Consumer<FOPReportConfig> arg0)
byte[] toPDF(String arg0)
ResultSet toResultSet()Convert to a ResultSet.
ResultSet toResultSet(Object arg0)
ResultSetRowMap toRow()
JDBCSQLCA toSQLCA(Object arg0)
String toString()Allow print(db.
String toText()
String toText(Consumer<ResultSetPrinterConfig> arg0)
byte[] toXLS()
byte[] toXLSX()

Method Detail

JSResultSetCursorReport

 JSResultSetCursorReport(JSResultSet rs)
Info:
Create an instance of ResultSetCursorReport based on given rs
Parameters:
rs - 

JSResultSetCursorReport

 JSResultSetCursorReport(SQLResultSetArray rs)
Info:
Create a report from a memory resultset
Parameters:
rs - 

__toResultSet

                        ResultSet __toResultSet(Object arg0)
Parameters:
arg0 - 
Returns:

asJSON

                        String asJSON()
Returns:

asJSON

void asJSON(Consumer<JSONExportOptions> arg0)
Parameters:
arg0 - 

close

void close()
Info:
Ensure the ResulSet is closed. Notice that if not, ResultSet will keep open when returning from a function that uses it in a report cause report has acquired a hold on it. SEE constructor acquireRefence() call Notice that rs may be a ResultSetCursor or memory resultset, not neccessary a JDBC ResultSet

compare

                        ResultSetComparator compare(IResultSetConvertible arg0)
Parameters:
arg0 - 
Returns:

compare

                        ResultSetComparator compare(IResultSetConvertible arg0, double arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

cursor

                        ResultSetCursorGroup cursor()
Returns:

equals

boolean equals(IResultSetConvertible arg0)
Parameters:
arg0 - 
Returns:

equals

boolean equals(IResultSetConvertible arg0, double arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

getJSResultSet

                        JSResultSet getJSResultSet()
Returns:
the JSResultSet that has created this report or null if comes from memory

getMetaData

                        SQLResultSetMetaData getMetaData()
Returns:
a memory metadata to allow change it's properties (like column scale)

isResultSet

boolean isResultSet(Object arg0)
Parameters:
arg0 - 
Returns:

iterator

                        Iterator iterator()
Returns:

setAccumulated

                        JSResultSetCursorReport setAccumulated(String name)
Parameters:
name - 
Returns:

setAvoidSingleRowTotals

                        JSResultSetCursorReport setAvoidSingleRowTotals(boolean collapse)
Parameters:
collapse - 
Returns:

setCollapseTotals

                        JSResultSetCursorReport setCollapseTotals(boolean collapse)
Parameters:
collapse - 
Returns:

setExpression

                        JSResultSetCursorReport setExpression(String name, String expression)
Parameters:
name - 
expression - 
Returns:

setGroupBy

                        ColumnGroup setGroupBy(String[] columnNames)
Parameters:
columnNames - 
Returns:

setHeader

                        JSResultSetCursorReport setHeader(int columnIndex, String headerLabel)
Parameters:
columnIndex - 
headerLabel - 
Returns:

setTotalBy

                        ColumnTotal setTotalBy(String name)
Info:
Set a default (SUM) General total by given column
Parameters:
name - 
Returns:

setTotalBy

                        ColumnTotal setTotalBy(String name, String[] statistics)
Info:
Set a General totals by given column
Parameters:
name - 
statistics - 
Returns:

setTotalByExpression

                        ColumnTotal setTotalByExpression(String name, String expression)
Parameters:
name - 
expression - 
Returns:

stream

                        ResultSetTupleStream stream()
Returns:

toCSV

                        String toCSV()
Returns:

toCSV

void toCSV(Consumer<CSVExportOptions> arg0)
Parameters:
arg0 - 

toExcel

byte[] toExcel()
Returns:

toExcel

void toExcel(Consumer<ExcelExportOptions> arg0)
Parameters:
arg0 - 

toFOP

                        String toFOP()
Returns:

toFOP

                        String toFOP(Consumer<FOPReportConfig> arg0)
Parameters:
arg0 - 
Returns:

toFOPTableBody

                        String toFOPTableBody(double arg0)
Parameters:
arg0 - 
Returns:

toFOPTableBody

                        String toFOPTableBody(Consumer<FOPReportConfig> arg0, double arg1)
Parameters:
arg0 - 
arg1 - 
Returns:

toHTML

                        String toHTML()
Returns:

toHTML

                        String toHTML(Consumer<HtmlConfigurator> arg0)
Parameters:
arg0 - 
Returns:

toJSON

                        String toJSON()
Returns:

toJSON

                        String toJSON(Consumer<JSONConfigurator> arg0)
Parameters:
arg0 - 
Returns:

toJavaScript

                        String toJavaScript()
Returns:

toPDF

byte[] toPDF()
Returns:

toPDF

byte[] toPDF(Consumer<FOPReportConfig> arg0)
Parameters:
arg0 - 
Returns:

toPDF

byte[] toPDF(String arg0)
Parameters:
arg0 - 
Returns:

toResultSet

                        ResultSet toResultSet()
Info:
Convert to a ResultSet. Ensure always return a beforeFirst positioned RS
Returns:

toResultSet

                        ResultSet toResultSet(Object arg0)
Parameters:
arg0 - 
Returns:

toRow

                        ResultSetRowMap toRow()
Returns:

toSQLCA

                        JDBCSQLCA toSQLCA(Object arg0)
Parameters:
arg0 - 
Returns:

toString

                        String toString()
Info:
Allow print(db.executeQuery(...));
Returns:

toText

                        String toText()
Returns:

toText

                        String toText(Consumer<ResultSetPrinterConfig> arg0)
Parameters:
arg0 - 
Returns:

toXLS

byte[] toXLS()
Returns:

toXLSX

byte[] toXLSX()
Returns:

3 Table

Class Ax.rs.Table


Wraps a ResultSetCursorTable. This provides javascript a way to handle table transactions using isdm cursor style objects. It includes the possibility to perform horizontal joins and the associated combined transactions. This means that the update (insert pending?) operation may be performed on multiple tables. We can use a test with 3 tables to show the use. country, region language Austria EU de Germany EU de Russia EA ru USA NA en Spain EU es Mexico SA es continents EU Europe AS Asia NA North America SA South America AF Africa AU Australia language description de German ru Russian en English

Constructor Summary

MethodDescription
JSResultSetCursorTable(JSConnection conn, String tableName, String cond, String sort)

Method Summary

Modifier and TypeMethodDescription
JSResultSetCursorTable addHorizontalJoin(String sql)
JSResultSetCursorTable addHorizontalJoin(String tableName, String joindCondition, String orderBy)
JSResultSetCursorTable setCacheSize(int size)

Method Detail

JSResultSetCursorTable

 JSResultSetCursorTable(JSConnection conn, String tableName, String cond, String sort)
Parameters:
conn - 
tableName - 
cond - 
sort - 

addHorizontalJoin

                        JSResultSetCursorTable addHorizontalJoin(String sql)
Parameters:
sql - 
Returns:

addHorizontalJoin

                        JSResultSetCursorTable addHorizontalJoin(String tableName, String joindCondition, String orderBy)
Parameters:
tableName - 
joindCondition - 
orderBy - 
Returns:

setCacheSize

                        JSResultSetCursorTable setCacheSize(int size)
Parameters:
size - 
Returns:

4 Reader

Class Ax.rs.Reader


ResulSetReader -

Constructor Summary

MethodDescription
JSResultSetReader()

Method Detail

JSResultSetReader

 JSResultSetReader()

build

                        SQLResultSetArray build(List src)
Info:
<script>
Parameters:
src - 
Returns:

Example
Copy
var rows = [
 		[1, "A", 1.3 ],
		[2, "B", 2.6 ],
		[3, "C", 3.9 ],
		];
		var rs = new Ax.rs.Reader().build(rows);
		var rs = new Ax.rs.Reader().build(rows, options - {options.setColumnNames(["a", "b", "c"])});
		console.log(rs);

build

                        SQLResultSetArray build(List src, Consumer<MemoryImportOptions> config)
Parameters:
src - 
config - 
Returns:

csv

                        SQLResultSetArray csv(File file)
Parameters:
file - 
Returns:

csv

                        SQLResultSetArray csv(URL url)
Parameters:
url - 
Returns:

csv

                        SQLResultSetArray csv(InputStream is)
Parameters:
is - 
Returns:

csv

                        SQLResultSetArray csv(CSVImportOptions options)
Parameters:
options - 
Returns:

csv

                        SQLResultSetArray csv(Consumer<CSVImportOptions> options)
Parameters:
options - 
Returns:

db

                        SQLResultSetArray db(Consumer<DBImportOptions> config)
Parameters:
config - 
Returns:

excel

                        SQLResultSetArray excel(File file)
Parameters:
file - 
Returns:

excel

                        SQLResultSetArray excel(URL url)
Parameters:
url - 
Returns:

excel

                        SQLResultSetArray excel(InputStream is)
Parameters:
is - 
Returns:

excel

                        SQLResultSetArray excel(Consumer<ExcelImportOptions> config)
Parameters:
config - 
Returns:

excel

                        SQLResultSetArray excel(ExcelImportOptions options)
Parameters:
options - 
Returns:

json

                        SQLResultSetArray json(Consumer<JSONImportOptions> config)
Parameters:
config - 
Returns:

memory

                        SQLResultSetArray memory(MemoryImportOptions options)
Parameters:
options - 
Returns:

memory

                        SQLResultSetArray memory(Consumer<MemoryImportOptions> config)
Parameters:
config - 
Returns:

text

                        SQLResultSetArray text(Consumer<TextImportOptions> config)
Parameters:
config - 
Returns:

5 Writer

Class Ax.rs.Writer


Constructor Summary

MethodDescription
JSResultSetWriter(IResultSetConvertible rs)

Method Summary

Modifier and TypeMethodDescription
ResultSet csv(File file)
ResultSet csv(OutputStream out)
ResultSet csv(Consumer<CSVExportOptions> configurator)
ResultSet db(Consumer<DBExportOptions> configurator)
ResultSet excel(File file)
ResultSet excel(OutputStream out)
ResultSet excel(Consumer<ExcelExportOptions> configurator)
RSExportStatistics getStatistics()
ResultSet json(Consumer<JSONExportOptions> configurator)
ResultSet sql(Consumer<SQLExportOptions> configurator)

Method Detail

JSResultSetWriter

 JSResultSetWriter(IResultSetConvertible rs)
Parameters:
rs - 

csv

                        ResultSet csv(File file)
Parameters:
file - 
Returns:

csv

                        ResultSet csv(OutputStream out)
Parameters:
out - 
Returns:

csv

                        ResultSet csv(Consumer<CSVExportOptions> configurator)
Parameters:
configurator - 
Returns:

db

                        ResultSet db(Consumer<DBExportOptions> configurator)
Parameters:
configurator - 
Returns:

excel

                        ResultSet excel(File file)
Parameters:
file - 
Returns:

excel

                        ResultSet excel(OutputStream out)
Parameters:
out - 
Returns:

excel

                        ResultSet excel(Consumer<ExcelExportOptions> configurator)
Parameters:
configurator - 
Returns:

getStatistics

                        RSExportStatistics getStatistics()
Returns:
the export statistics (# rows inserted, updated, errors, excluded) witch is specially need when operation is db()

json

                        ResultSet json(Consumer<JSONExportOptions> configurator)
Parameters:
configurator - 
Returns:

sql

                        ResultSet sql(Consumer<SQLExportOptions> configurator)
Parameters:
configurator - 
Returns:

6 PivotUtils

Class Ax.rs.PivotUtils


Method Summary

Modifier and TypeMethodDescription
static int getColumnCount(ResultSet rs)
static Object getColumnData(ResultSet rs, String colname, String pivotname)

Method Detail

getColumnCount

static int getColumnCount(ResultSet rs)
Parameters:
rs - 
Returns:

getColumnData

static Object getColumnData(ResultSet rs, String colname, String pivotname)
Parameters:
rs - 
colname - 
pivotname - 
Returns:

7 DataParser

Class deister.axional.server.jdbc.formats.parsers.DataParser


A Function implementation of a Parser than can parse a String value into some another type. A design feature of the Parser framework is that it can be used to parse primitives while avoiding boxing, which can make a difference when parsing very large files. The Function1 interface exposes a number of applyXXX() methods that yield primitives, and a getStyle() method that can be queried to check what type the function supports.

Constructor Summary

MethodDescription
DataParser(FunctionStyle style, int type, ToBooleanFunction<String> nullChecker)Constructor

Method Summary

Modifier and TypeMethodDescription
apply(I value)
Boolean applyAsBoolean(I value)Transforms some input value into a primitive boolean
Double applyAsDouble(I value)Transforms some input value into a primitive double
Float applyAsFloat(I value)Transforms some input value into a primitive double
Integer applyAsInt(I value)Transforms some input value into a primitive int
Long applyAsLong(I value)Transforms some input value into a primitive long
ToBooleanFunction getNullChecker()Returns the null checker for this parser
Integer getSQLType(Object object)
FunctionStyle getStyle()Returns the type for this mapper
int getType()Returns the data type produced by this parser
boolean isSupported(String value)Returns true if this parser can process the value specified
DataParser ofBigDecimal()Returns a newly created Parser for BigDecimal
DataParser ofBoolean()Returns a newly created Parser for Boolean
DataParser ofDouble()Returns a newly created Parser for Double
DataParser ofDouble(String pattern, int multiplier)Returns a newly created Parser for Double
DataParser ofFloat()Returns a newly created Parser for Double
DataParser ofInteger()Returns a newly created Parser for Integer
DataParser ofJavaDate()Returns a newly created Parser for LocalDate
DataParser ofJavaDate(String pattern)Returns a newly created Parser for LocalDate
DataParser ofJavaDate(DateTimeFormatter format)Returns a newly created Parser for LocalDate
DataParser ofLong()Returns a newly created Parser for Long
DataParser ofObject()Returns a newly created Parser for Object
DataParser ofSQLDate()Returns a newly created Parser for LocalTime
DataParser ofSQLDate(String pattern)Returns a newly created Parser for LocalTime
DataParser ofSQLDate(DateTimeFormatter format)Returns a newly created Parser for LocalTime
DataParser ofSQLTime()Returns a newly created Parser for LocalTime
DataParser ofSQLTime(String pattern)Returns a newly created Parser for LocalTime
DataParser ofSQLTime(DateTimeFormatter format)Returns a newly created Parser for LocalTime
ParserOfSQLTimestamp ofSQLTimestamp()Returns a newly created Parser for LocalDateTime
ParserOfSQLTimestamp ofSQLTimestamp(String pattern)Returns a newly created Parser for LocalDateTime
ParserOfSQLTimestamp ofSQLTimestamp(DateTimeFormatter format)Returns a newly created Parser for LocalDateTime
DataParser ofString()Returns a newly created Parser for String
DataParser optimize(String value)Returns a possibly modified version of this parser optimized to parse values of the form presented
FunctionReadPrimitives toBoolean(ToBooleanFunction<I> function)Creates an BOOLEAN mapper that wraps to function provided
FunctionReadPrimitives toDouble(ToDoubleFunction<I> function)Creates an DOUBLE mapper that wraps to function provided
FunctionReadPrimitives toInt(ToIntFunction<I> function)Creates an INTEGER mapper that wraps to function provided
FunctionReadPrimitives toLong(ToLongFunction<I> function)Creates an LONG mapper that wraps to function provided
String toString()To allow simply see the parser name
FunctionReadPrimitives toValue(Function<IO> function)Creates an OBJECT mapper that wraps to function provided
DataParser withNullChecker(String[] nulls)Applies the null checker function for this Parser
DataParser withNullChecker(ToBooleanFunction<String> nullChecker)Applies the null checker function for this Parser

Method Detail

DataParser

 DataParser(FunctionStyle style, int type, ToBooleanFunction<String> nullChecker)
Info:
Constructor
Parameters:
style - the style for this function
type - the data type produced by this parser
nullChecker - the null checker function

apply

O apply(I value)
Parameters:
value - 
Returns:

applyAsBoolean

                        Boolean applyAsBoolean(I value)
Info:
Transforms some input value into a primitive boolean
Parameters:
value - the value to transform
Returns:
the primitive boolean

applyAsDouble

                        Double applyAsDouble(I value)
Info:
Transforms some input value into a primitive double
Parameters:
value - the value to transform
Returns:
the primitive double

applyAsFloat

                        Float applyAsFloat(I value)
Info:
Transforms some input value into a primitive double
Parameters:
value - the value to transform
Returns:
the primitive double

applyAsInt

                        Integer applyAsInt(I value)
Info:
Transforms some input value into a primitive int
Parameters:
value - the value to transform
Returns:
the primitive int

applyAsLong

                        Long applyAsLong(I value)
Info:
Transforms some input value into a primitive long
Parameters:
value - the value to transform
Returns:
the primitive long

getNullChecker

                        ToBooleanFunction getNullChecker()
Info:
Returns the null checker for this parser
Returns:
the null checker

getSQLType

                        Integer getSQLType(Object object)
Parameters:
object - 
Returns:

getStyle

                        FunctionStyle getStyle()
Info:
Returns the type for this mapper
Returns:
the type for this mapper

getType

int getType()
Info:
Returns the data type produced by this parser
Returns:
the data type for this parser

isSupported

boolean isSupported(String value)
Info:
Returns true if this parser can process the value specified
Parameters:
value - the value to check if can be parsed by this parser
Returns:
true if the value can be parsed

ofBigDecimal

                        DataParser ofBigDecimal()
Info:
Returns a newly created Parser for BigDecimal
Returns:
newly created Parser

ofBoolean

                        DataParser ofBoolean()
Info:
Returns a newly created Parser for Boolean
Returns:
newly created Parser

ofDouble

                        DataParser ofDouble()
Info:
Returns a newly created Parser for Double
Returns:
newly created Parser

ofDouble

                        DataParser ofDouble(String pattern, int multiplier)
Info:
Returns a newly created Parser for Double
Parameters:
pattern - the decimal format pattern
multiplier - the multiplier to apply
Returns:
newly created Parser

ofFloat

                        DataParser ofFloat()
Info:
Returns a newly created Parser for Double
Returns:
newly created Parser

ofInteger

                        DataParser ofInteger()
Info:
Returns a newly created Parser for Integer
Returns:
newly created Parser

ofJavaDate

                        DataParser ofJavaDate()
Info:
Returns a newly created Parser for LocalDate
Returns:
newly created Parser

ofJavaDate

                        DataParser ofJavaDate(String pattern)
Info:
Returns a newly created Parser for LocalDate
Parameters:
pattern - the date time format pattern
Returns:
newly created Parser

ofJavaDate

                        DataParser ofJavaDate(DateTimeFormatter format)
Info:
Returns a newly created Parser for LocalDate
Parameters:
format - the date format
Returns:
newly created Parser

ofLong

                        DataParser ofLong()
Info:
Returns a newly created Parser for Long
Returns:
newly created Parser

ofObject

                        DataParser ofObject()
Info:
Returns a newly created Parser for Object
Returns:
newly created Parser

ofSQLDate

                        DataParser ofSQLDate()
Info:
Returns a newly created Parser for LocalTime
Returns:
newly created Parser

ofSQLDate

                        DataParser ofSQLDate(String pattern)
Info:
Returns a newly created Parser for LocalTime
Parameters:
pattern - 
Returns:
newly created Parser

ofSQLDate

                        DataParser ofSQLDate(DateTimeFormatter format)
Info:
Returns a newly created Parser for LocalTime
Parameters:
format - the date format
Returns:
newly created Parser

ofSQLTime

                        DataParser ofSQLTime()
Info:
Returns a newly created Parser for LocalTime
Returns:
newly created Parser

ofSQLTime

                        DataParser ofSQLTime(String pattern)
Info:
Returns a newly created Parser for LocalTime
Parameters:
pattern - 
Returns:
newly created Parser

ofSQLTime

                        DataParser ofSQLTime(DateTimeFormatter format)
Info:
Returns a newly created Parser for LocalTime
Parameters:
format - the date format
Returns:
newly created Parser

ofSQLTimestamp

                        ParserOfSQLTimestamp ofSQLTimestamp()
Info:
Returns a newly created Parser for LocalDateTime
Returns:
newly created Parser

ofSQLTimestamp

                        ParserOfSQLTimestamp ofSQLTimestamp(String pattern)
Info:
Returns a newly created Parser for LocalDateTime
Parameters:
pattern - the date time format pattern
Returns:
newly created Parser

ofSQLTimestamp

                        ParserOfSQLTimestamp ofSQLTimestamp(DateTimeFormatter format)
Info:
Returns a newly created Parser for LocalDateTime
Parameters:
format - the date time format
Returns:
newly created Parser

ofString

                        DataParser ofString()
Info:
Returns a newly created Parser for String
Returns:
newly created Parser

optimize

                        DataParser optimize(String value)
Info:
Returns a possibly modified version of this parser optimized to parse values of the form presented
Parameters:
value - the format of the value to optimize for
Returns:
the newly created parser, or this parser if no optimizations can be done

toBoolean

                        FunctionReadPrimitives toBoolean(ToBooleanFunction<I> function)
Info:
Creates an BOOLEAN mapper that wraps to function provided
Parameters:
function - the function to wrap
Returns:
the newly created mapper

toDouble

                        FunctionReadPrimitives toDouble(ToDoubleFunction<I> function)
Info:
Creates an DOUBLE mapper that wraps to function provided
Parameters:
function - the function to wrap
Returns:
the newly created mapper

toInt

                        FunctionReadPrimitives toInt(ToIntFunction<I> function)
Info:
Creates an INTEGER mapper that wraps to function provided
Parameters:
function - the function to wrap
Returns:
the newly created mapper

toLong

                        FunctionReadPrimitives toLong(ToLongFunction<I> function)
Info:
Creates an LONG mapper that wraps to function provided
Parameters:
function - the function to wrap
Returns:
the newly created mapper

toString

                        String toString()
Info:
To allow simply see the parser name
Returns:

toValue

                        FunctionReadPrimitives toValue(Function<IO> function)
Info:
Creates an OBJECT mapper that wraps to function provided
Parameters:
function - the function to wrap
Returns:
the newly created mapper

withNullChecker

                        DataParser withNullChecker(String[] nulls)
Info:
Applies the null checker function for this Parser
Parameters:
nulls - 
Returns:
this Parser

withNullChecker

                        DataParser withNullChecker(ToBooleanFunction<String> nullChecker)
Info:
Applies the null checker function for this Parser
Parameters:
nullChecker - the null checker function
Returns:
this Parser