Examples of SQLContainer


Examples of com.vaadin.addon.sqlcontainer.SQLContainer

          "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
      e.printStackTrace();
    }
    return container;
View Full Code Here

Examples of com.vaadin.addon.sqlcontainer.SQLContainer

    String sQuery = "SELECT service,theme,action,validation FROM myActions WHERE validation='EN COURS' AND idAeroport='"+airport+"'";
   
    try {
      pool = new SimpleJDBCConnectionPool("com.mysql.jdbc.Driver","jdbc:mysql://localhost:3306/pl", "root", "0");
      query = new FreeformQuery(sQuery, pool, "id");
      container = new SQLContainer(query);
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return container;
View Full Code Here

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

            generateTestData(connectionPool);

            TableQuery query = new TableQuery("people", connectionPool,
                    new DefaultSQLGenerator());

            SQLContainer container = new LimitedSQLContainer(query);

            final VerticalLayout rootLayout = new VerticalLayout();

            final Table table = new Table();
            table.setContainerDataSource(container);
View Full Code Here

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

    private void initContainers() {
        try {
            TableQuery q1 = new TableQuery(TABLENAME, connectionPool);
            q1.setVersionColumn("id");
            testContainer = new SQLContainer(q1);

            TableQuery q2 = new TableQuery(LARGE_TABLENAME, connectionPool);
            q2.setVersionColumn("id");
            largeContainer = new SQLContainer(q2);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

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

            createTestTable(connectionPool);
            insertTestData(connectionPool);

            TableQuery q = new TableQuery("MYTABLE2", connectionPool);
            q.setVersionColumn("VERSION");
            SQLContainer myContainer = new SQLContainer(q);
            // Uncommenting these works around the issue
            // myContainer.addOrderBy(new OrderBy("PFX", true));
            // myContainer.addOrderBy(new OrderBy("NUMERO", true));
            myContainer.removeAllContainerFilters();
            myContainer.addContainerFilter(new Equal("PFX", "C"));

            VerticalLayout layout = new VerticalLayout();
            mainWindow.setContent(layout);

            final ComboBox myCombo = new ComboBox("MyCaption");
View Full Code Here

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

                try {
                    int cents = 100;
                    for (int cent = 0; cent < cents; cent++) {
                        TableQuery q = new TableQuery("AUTHOR", pool);
                        q.setVersionColumn("ID");
                        SQLContainer c = new SQLContainer(q);
                        for (int i = 0; i < 100; i++) {
                            Object id = c.addItem();
                            c.getContainerProperty(id, "FIRST_NAMES").setValue(
                                    getRandonName());
                            c.getContainerProperty(id, "LAST_NAME").setValue(
                                    getRandonName());
                        }
                        c.commit();
                        getContext().lock();
                        try {
                            proggress
                                    .setValue(new Float((1.0f * cent) / cents));
                            proggress.setCaption("" + 100 * cent
 
View Full Code Here

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

    @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.SQLContainer

    @Test(expected = UnsupportedOperationException.class)
    public void storeRow_noDelegate_shouldFail() throws SQLException {
        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();
View Full Code Here

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

    @Test(expected = UnsupportedOperationException.class)
    public void removeRow_noDelegate_shouldFail() throws SQLException {
        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();
View Full Code Here

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

        FreeformQueryDelegate delegate = EasyMock
                .createMock(FreeformQueryDelegate.class);
        EasyMock.expect(
                delegate.storeRow(EasyMock.isA(Connection.class),
                        EasyMock.isA(RowItem.class))).andReturn(1);
        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 }),
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.