Examples of FreeformQuery


Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

        Assert.assertEquals("Ville", item.getItemProperty("NAME").getValue());
    }

    @Test
    public void nextItemNullAtEnd_freeformExistingItem() throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Object lastItemId = container.lastItemId();
        Object afterLast = container.nextItemId(lastItemId);
        Assert.assertNull(afterLast);
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

        Assert.assertNull(afterLast);
    }

    @Test
    public void prevItemNullAtStart_freeformExistingItem() throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Object firstItemId = container.firstItemId();
        Object beforeFirst = container.prevItemId(firstItemId);
        Assert.assertNull(beforeFirst);
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

    @Test
    public void getItem_freeform5000RowsWithParameter1337_returnsItemWithId1337()
            throws SQLException {
        DataGenerator.addFiveThousandPeople(connectionPool);
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Item item;
        if (SQLTestsConstants.db == DB.ORACLE) {
            item = container.getItem(new RowId(new Object[] { new BigDecimal(
                    1337 + offset) }));
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

    }

    @Test
    public void getItemIds_freeform_returnsItemIdsWithKeys0through3()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Collection<?> itemIds = container.getItemIds();
        Assert.assertEquals(4, itemIds.size());
        RowId zero = new RowId(new Object[] { 0 + offset });
        RowId one = new RowId(new Object[] { 1 + offset });
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

    }

    @Test
    public void getType_freeformNAMEPropertyId_returnsString()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertEquals(String.class, container.getType("NAME"));
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

    }

    @Test
    public void getType_freeformIDPropertyId_returnsInteger()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        if (SQLTestsConstants.db == DB.ORACLE) {
            Assert.assertEquals(BigDecimal.class, container.getType("ID"));
        } else {
            Assert.assertEquals(Integer.class, container.getType("ID"));
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

    }

    @Test
    public void getType_freeformNonexistingPropertyId_returnsNull()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertNull(container.getType("asdf"));
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

        Assert.assertNull(container.getType("asdf"));
    }

    @Test
    public void size_freeform_returnsFour() throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertEquals(4, container.size());
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

        }
        statement.close();
        conn.commit();
        connectionPool.releaseConnection(conn);

        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertEquals(5, container.size());
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.query.FreeformQuery

    }

    @Test
    public void indexOfId_freeformWithParameterThree_returnsThree()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        if (SQLTestsConstants.db == DB.ORACLE) {
            Assert.assertEquals(3, container.indexOfId(new RowId(
                    new Object[] { new BigDecimal(3 + offset) })));
        } else {
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.