Examples of FreeformQuery


Examples of com.vaadin.addon.sqlcontainer.query.FreeformQuery

    try {
     
      pool = new SimpleJDBCConnectionPool("com.mysql.jdbc.Driver",
          "jdbc:mysql://localhost:3306/pl", "root", "0");
      //tableQuery = new TableQuery("myActions", pool);
      query = new FreeformQuery(sQuery, pool, "id");
      //query.setDelegate(new _FreeFormDelegate());
      //container = new SQLContainer(tableQuery);
      container = new SQLContainer(query);
    } catch (SQLException e) {
      // TODO Auto-generated catch block
View Full Code Here

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

    }

    @Test
    public void constructor_withFreeformQuery_shouldSucceed()
            throws SQLException {
        new SQLContainer(new FreeformQuery("SELECT * FROM people",
                connectionPool, "ID"));
    }
View Full Code Here

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

    }

    @Test(expected = SQLException.class)
    public void constructor_withIllegalFreeformQuery_shouldFail()
            throws SQLException {
        SQLContainer c = new SQLContainer(new FreeformQuery(
                "SELECT * FROM asdf", connectionPool, "ID"));
        c.getItem(c.firstItemId());
    }
View Full Code Here

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

    }

    @Test
    public void containsId_withFreeformQueryAndExistingId_returnsTrue()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertTrue(container.containsId(new RowId(new Object[] { 1 })));
    }
View Full Code Here

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

    }

    @Test
    public void containsId_withFreeformQueryAndNonexistingId_returnsFalse()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertFalse(container
                .containsId(new RowId(new Object[] { 1337 })));
    }
View Full Code Here

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

    }

    @Test
    public void getContainerProperty_freeformExistingItemIdAndPropertyId_returnsProperty()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        if (SQLTestsConstants.db == DB.ORACLE) {
            Assert.assertEquals(
                    "Ville",
                    container
View Full Code Here

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

    }

    @Test
    public void getContainerProperty_freeformExistingItemIdAndNonexistingPropertyId_returnsNull()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertNull(container.getContainerProperty(new RowId(
                new Object[] { 1 + offset }), "asdf"));
    }
View Full Code Here

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

    }

    @Test
    public void getContainerProperty_freeformNonexistingItemId_returnsNull()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Assert.assertNull(container.getContainerProperty(new RowId(
                new Object[] { 1337 + offset }), "NAME"));
    }
View Full Code Here

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

    }

    @Test
    public void getContainerPropertyIds_freeform_returnsIDAndNAME()
            throws SQLException {
        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Collection<?> propertyIds = container.getContainerPropertyIds();
        Assert.assertEquals(3, propertyIds.size());
        Assert.assertArrayEquals(new String[] { "ID", "NAME", "AGE" },
                propertyIds.toArray());
View Full Code Here

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

    }

    @Test
    public void getItem_freeformExistingItemId_returnsItem()
            throws SQLException {
        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(
                    0 + offset) }));
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.