Niclas Hedhman wrote:
> On Tue, Apr 29, 2008 at 8:12 PM, Nino Saturnino Martinez Vazquez Wael
> <[EMAIL PROTECTED]> wrote:
>> Yes, it's used quite a lot. Having a minimum of knowlegde of the query
>>  api. Below are a sniplet of how a sortable dataprovider could be
>>  implemented in wicket(notice that the provided example doesnt actually
>>  support sorting, but pagination) using pojo's, does the query interface
>>  support that?:
> 
> Yes. The fact is I am using this to implement the EntityListViewPanel,
> which should be given a IModel containing a Query instance. The Query
> interface looks like this at the moment;
> 
> public interface Query<T>
>     extends Iterable<T>
> {
>     Query<T> orderBy( OrderBy... segments );
>     Query<T> firstResult( int firstResult );
>     Query<T> maxResults( int maxResults );
>     T find();
>     void setVariable( String name, Object value );
>     <V> V getVariable( String name );
> }
> 
> I.e. good match with the IDataProvider interface in Wicket (except the 
> size()).

The problem with size() is that it would have to execute the Query, 
which is what iterator() and find() does today. So, if you add size(), 
then that would add another way to execute the query. Is this ok? Is it 
important enough that it should be a base function? Or should paginators 
get the iterator and copy it to a list for such functionality? (which 
would make firstResult/maxResults less useful though)

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to