Examples of RowId


Examples of com.vaadin.addon.sqlcontainer.RowId

                    primaryKeyColumns.toArray(new String[0]));
            sh.setParameterValuesToStatement(pstmt);
            debug("DB -> " + sh.getQueryString());
            int result = pstmt.executeUpdate();
            genKeys = pstmt.getGeneratedKeys();
            RowId newId = getNewRowId(row, genKeys);
            bufferedEvents.add(new RowIdChangeEvent(row.getId(), newId));
            return result;
        } finally {
            if (genKeys != null) {
                genKeys.close();
View Full Code Here

Examples of com.vaadin.addon.sqlcontainer.RowId

            } else {
                for (String s : primaryKeyColumns) {
                    newRowId.add(values.get(s));
                }
            }
            return new RowId(newRowId.toArray());
        } catch (Exception e) {
            debug("Failed to fetch key values on insert: " + e.getMessage());
            return null;
        }
    }
View Full Code Here

Examples of com.vaadin.addon.sqlcontainer.RowId

            /*
             * If affected rows exist, we'll get the new RowId, commit the
             * transaction and return the new RowId.
             */
            ResultSet generatedKeys = pstmt.getGeneratedKeys();
            RowId newId = getNewRowId(row, generatedKeys);
            generatedKeys.close();
            pstmt.clearParameters();
            pstmt.close();
            commit();
            return newId;
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.RowId

            pstmt = connection.prepareStatement(sh.getQueryString(),
                    primaryKeyColumns.toArray(new String[0]));
            sh.setParameterValuesToStatement(pstmt);
            getLogger().log(Level.FINE, "DB -> {0}", sh.getQueryString());
            int result = pstmt.executeUpdate();
            RowId newId = null;
            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

Examples of com.vaadin.data.util.sqlcontainer.RowId

                    primaryKeyColumns.toArray(new String[0]));
            sh.setParameterValuesToStatement(pstmt);
            getLogger().log(Level.FINE, "DB -> {0}", sh.getQueryString());
            int result = pstmt.executeUpdate();
            genKeys = pstmt.getGeneratedKeys();
            RowId newId = getNewRowId(row, genKeys);
            bufferedEvents.add(new RowIdChangeEvent(row.getId(), newId));
            return result;
        } finally {
            releaseConnection(connection, pstmt, genKeys);
        }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.RowId

            } else {
                for (String s : primaryKeyColumns) {
                    newRowId.add(values.get(s));
                }
            }
            return new RowId(newRowId.toArray());
        } catch (Exception e) {
            getLogger()
                    .log(Level.FINE,
                            "Failed to fetch key values on insert: {0}",
                            e.getMessage());
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.RowId

    @Test(expected = IllegalStateException.class)
    public void storeRow_noDelegateNoTransactionActive_shouldFail()
            throws SQLException {
        FreeformQuery query = new FreeformQuery("SELECT * FROM people",
                Arrays.asList("ID"), connectionPool);
        query.storeRow(new RowItem(new SQLContainer(query), new RowId(
                new Object[] { 1 }), null));
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.RowId

        FreeformQuery query = new FreeformQuery("SELECT * FROM people",
                Arrays.asList("ID"), connectionPool);
        SQLContainer container = EasyMock.createNiceMock(SQLContainer.class);
        EasyMock.replay(container);
        query.beginTransaction();
        query.storeRow(new RowItem(container, new RowId(new Object[] { 1 }),
                null));
        query.commit();
        EasyMock.verify(container);
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.RowId

        FreeformQuery query = new FreeformQuery("SELECT * FROM people",
                Arrays.asList("ID"), connectionPool);
        SQLContainer container = EasyMock.createNiceMock(SQLContainer.class);
        EasyMock.replay(container);
        query.beginTransaction();
        query.removeRow(new RowItem(container, new RowId(new Object[] { 1 }),
                null));
        query.commit();
        EasyMock.verify(container);
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.RowId

        SQLContainer container = EasyMock.createNiceMock(SQLContainer.class);
        EasyMock.replay(delegate, container);
        query.setDelegate(delegate);

        query.beginTransaction();
        RowItem row = new RowItem(container, new RowId(new Object[] { 1 }),
                null);
        query.storeRow(row);
        query.commit();

        EasyMock.verify(delegate, container);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.