ondrej-kvasnovsky / lazy-container

Lazy containers for Vaadin 7
8 stars 6 forks source link

LazyBeanContainer: many query's in the database #1

Closed sergiomichels closed 11 years ago

sergiomichels commented 11 years ago

Please, correct me if I'm messing up.

I created a DAO and a SearchCriteria. In my DAO I put a debug to see the query that's made. I can see that the query runs more than once when I'm loading my view.

The first time, when I set the container in the PagedTable, the query runs for 25 records:

totalCount: 3722 start: 0 , count: 25

After that, the query run one more time, but with 10 (PagedTable changed the number of records per page?)

start: 0 , count: 10

Then, the query runs one more time for each Converter that I add to the table:

table.setConverter("myField", new Converter<String, String>(){ ... });

start: 0 , count: 10 start: 0 , count: 10 start: 0 , count: 10

Am I'm missing something or the setConverter shouldn't touch the database?

sergiomichels commented 11 years ago

It seems that setting other properties in the table also trigger the query:

setVisibleColumns()
setColumnCollapsingAllowed()

But looking here it seems that this occurs because the table is already added in the main layout. Is this the default behavior?

ondrej-kvasnovsky commented 11 years ago

I already complained about that http://dev.vaadin.com/ticket/10473. Unfortunately, it is caused by Vaadin not this container.