org.domdrides.wicket.model.repeater
Class PageableRepositoryDataProvider<EntityType extends Entity<IdType>,IdType extends java.io.Serializable>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider<EntityType>
      extended by org.domdrides.wicket.model.repeater.PageableRepositoryDataProvider<EntityType,IdType>
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator, org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider<EntityType>, org.apache.wicket.IClusterable, org.apache.wicket.markup.repeater.data.IDataProvider<EntityType>, org.apache.wicket.model.IDetachable

public class PageableRepositoryDataProvider<EntityType extends Entity<IdType>,IdType extends java.io.Serializable>
extends org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider<EntityType>

A PageableRepository-based implementation of IDataProvider. Each @{Entity} returned by this data provider will be wrapped with a LoadableDetachableEntityModel.

Since:
1.1
See Also:
Serialized Form

Constructor Summary
PageableRepositoryDataProvider(PageableRepository<EntityType,IdType> repository, java.lang.String sortProperty)
          Constructs a data provider which returns records from the specified PageableRepository sorted by the specified sort property (ascending)
PageableRepositoryDataProvider(PageableRepository<EntityType,IdType> repository, java.lang.String sortProperty, boolean ascending)
          Constructs a data provider which returns records from the specified PageableRepository sorted by the specified sort property.
 
Method Summary
 java.util.Iterator<? extends EntityType> iterator(int first, int max)
           
 org.apache.wicket.model.IModel<EntityType> model(EntityType entity)
           
 int size()
           
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider
detach, getSort, getSortState, setSort, setSort, setSortState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageableRepositoryDataProvider

public PageableRepositoryDataProvider(PageableRepository<EntityType,IdType> repository,
                                      java.lang.String sortProperty,
                                      boolean ascending)
Constructs a data provider which returns records from the specified PageableRepository sorted by the specified sort property.

Parameters:
repository - the repository
sortProperty - the sort property
ascending - whether or not to sort ascending

PageableRepositoryDataProvider

public PageableRepositoryDataProvider(PageableRepository<EntityType,IdType> repository,
                                      java.lang.String sortProperty)
Constructs a data provider which returns records from the specified PageableRepository sorted by the specified sort property (ascending)

Parameters:
repository - the repository
sortProperty - the sort property
Method Detail

iterator

public java.util.Iterator<? extends EntityType> iterator(int first,
                                                         int max)

size

public int size()

model

public org.apache.wicket.model.IModel<EntityType> model(EntityType entity)


Copyright © 2008. All Rights Reserved.