Search in sources :

Example 1 with Parser

use of org.h2.command.Parser in project siena by mandubian.

the class FullText method parseKey.

/**
     * Parse a primary key condition into the primary key columns.
     *
     * @param conn the database connection
     * @param key the primary key condition as a string
     * @return an array containing the column name list and the data list
     */
protected static Object[][] parseKey(Connection conn, String key) {
    ArrayList<String> columns = New.arrayList();
    ArrayList<String> data = New.arrayList();
    JdbcConnection c = (JdbcConnection) conn;
    Session session = (Session) c.getSession();
    Parser p = new Parser(session);
    Expression expr = p.parseExpression(key);
    addColumnData(columns, data, expr);
    Object[] col = new Object[columns.size()];
    columns.toArray(col);
    Object[] dat = new Object[columns.size()];
    data.toArray(dat);
    Object[][] columnData = { col, dat };
    return columnData;
}
Also used : ValueExpression(org.h2.expression.ValueExpression) Expression(org.h2.expression.Expression) JdbcConnection(org.h2.jdbc.JdbcConnection) Session(org.h2.engine.Session) Parser(org.h2.command.Parser)

Aggregations

Parser (org.h2.command.Parser)1 Session (org.h2.engine.Session)1 Expression (org.h2.expression.Expression)1 ValueExpression (org.h2.expression.ValueExpression)1 JdbcConnection (org.h2.jdbc.JdbcConnection)1