Package com.vaadin.addon.sqlcontainer.query.generator

Examples of com.vaadin.addon.sqlcontainer.query.generator.StatementHelper


    public RowId storeRowImmediately(RowItem row) throws SQLException {
        beginTransaction();
        /* Set version column, if one is provided */
        setVersionColumnFlagInProperty(row);
        /* Generate query */
        StatementHelper sh = sqlGenerator.generateInsertQuery(tableName, row);
        PreparedStatement pstmt = activeConnection.prepareStatement(
                sh.getQueryString(), primaryKeyColumns.toArray(new String[0]));
        sh.setParameterValuesToStatement(pstmt);
        debug("DB -> " + sh.getQueryString());
        int result = pstmt.executeUpdate();
        if (result > 0) {
            /*
             * If affected rows exist, we'll get the new RowId, commit the
             * transaction and return the new RowId.
View Full Code Here


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

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

TOP

Related Classes of com.vaadin.addon.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.