Package com.vaadin.data.util.sqlcontainer.query.generator

Examples of com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper


        int ix = 0;
        for (String colName : primaryKeyColumns) {
            filtersAndKeys.add(new Equal(colName, keys[ix]));
            ix++;
        }
        StatementHelper sh = sqlGenerator.generateSelectQuery(tableName,
                filtersAndKeys, orderBys, 0, 0, "*");

        boolean shouldCloseTransaction = false;
        if (!transactionOpen) {
            shouldCloseTransaction = true;
View Full Code Here


            return count;
        }
        /* First try using prepared statement */
        if (delegate instanceof FreeformStatementDelegate) {
            try {
                StatementHelper sh = ((FreeformStatementDelegate) delegate)
                        .getCountStatement();
                PreparedStatement pstmt = null;
                ResultSet rs = null;
                Connection c = getConnection();
                try {
                    pstmt = c.prepareStatement(sh.getQueryString());
                    sh.setParameterValuesToStatement(pstmt);
                    rs = pstmt.executeQuery();
                    rs.next();
                    count = rs.getInt(1);
                } finally {
                    releaseConnection(c, pstmt, rs);
View Full Code Here

        String query = queryString;
        if (delegate != null) {
            /* First try using prepared statement */
            if (delegate instanceof FreeformStatementDelegate) {
                try {
                    StatementHelper sh = ((FreeformStatementDelegate) delegate)
                            .getQueryStatement(offset, pagelength);
                    PreparedStatement pstmt = activeConnection
                            .prepareStatement(sh.getQueryString());
                    sh.setParameterValuesToStatement(pstmt);
                    return pstmt.executeQuery();
                } catch (UnsupportedOperationException e) {
                    // Statement generation not supported, continue...
                }
            }
View Full Code Here

            return false;
        }
        /* First try using prepared statement */
        if (delegate instanceof FreeformStatementDelegate) {
            try {
                StatementHelper sh = ((FreeformStatementDelegate) delegate)
                        .getCountStatement();
                if (sh != null && sh.getQueryString() != null
                        && sh.getQueryString().length() > 0) {
                    return true;
                }
            } catch (UnsupportedOperationException e) {
                // Statement generation not supported, continue...
            }
View Full Code Here

        String query = null;
        boolean contains = false;
        if (delegate != null) {
            if (delegate instanceof FreeformStatementDelegate) {
                try {
                    StatementHelper sh = ((FreeformStatementDelegate) delegate)
                            .getContainsRowQueryStatement(keys);

                    PreparedStatement pstmt = null;
                    ResultSet rs = null;
                    Connection c = getConnection();
                    try {
                        pstmt = c.prepareStatement(sh.getQueryString());
                        sh.setParameterValuesToStatement(pstmt);
                        rs = pstmt.executeQuery();
                        contains = rs.next();
                        return contains;
                    } finally {
                        releaseConnection(c, pstmt, rs);
View Full Code Here

TOP

Related Classes of com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.