3

Vaadin的书说:

通常,SQLContainer 会在需要时自动处理刷新。

但是,这是在哪里定义的?容器多久刷新一次?

我试图对此进行测试但无法解决

4

1 回答 1

1

您可以简单地检查SQLContainer代码。

词组

通常,SQLContainer 会在需要时自动处理刷新。

意味着 SQLContainer 将在对其状态进行一些更改后自行刷新。例如,添加orderBy refresh()后将被调用:

   /**
     * Adds the given OrderBy to this container and refreshes the container
     * contents with the new sorting rules.
     * 
     * Note that orderBy.getColumn() must return a column name that exists in
     * this container.
     * 
     * @param orderBy
     *            OrderBy to be added to the container sorting rules
     */
    public void addOrderBy(OrderBy orderBy) {
        if (orderBy == null) {
            return;
        }
        if (!propertyIds.contains(orderBy.getColumn())) {
            throw new IllegalArgumentException(
                    "The column given for sorting does not exist in this container.");
        }
        sorters.add(orderBy);
        refresh();
    }

这适用于所有其他操作(请注意refresh()调用):

  public void rollback() throws UnsupportedOperationException, SQLException {
        debug(null, "Rolling back changes...");
        removedItems.clear();
        addedItems.clear();
        modifiedItems.clear();
        refresh();
    }
于 2013-07-30T16:38:52.330 回答