org.jboss.seam.rest.example.tasks.resource
Class CollectionBean

java.lang.Object
  extended by org.jboss.seam.rest.example.tasks.resource.CollectionBean

public class CollectionBean
extends Object

Loads collections of Tasks and Categories from database.

Author:
Jozef Hartinger

Constructor Summary
CollectionBean()
           
 
Method Summary
protected  void applyPaginationParameters(Query query, int start, int limit)
          Sets paginatation parameters
protected  Query applyResolutionParameter(Query query, String status)
          Modifies query passed as a parameter to filter out tasks based on their status (resolved/unresolved/all)
 List<Category> getCategories(int start, int limit)
           
 List<Task> getTasks(int start, int limit, String status, String categoryName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionBean

public CollectionBean()
Method Detail

getCategories

public List<Category> getCategories(int start,
                                    int limit)

getTasks

public List<Task> getTasks(int start,
                           int limit,
                           String status,
                           String categoryName)

applyResolutionParameter

protected Query applyResolutionParameter(Query query,
                                         String status)
Modifies query passed as a parameter to filter out tasks based on their status (resolved/unresolved/all)


applyPaginationParameters

protected void applyPaginationParameters(Query query,
                                         int start,
                                         int limit)
Sets paginatation parameters

Parameters:
query - JPA query
start - the first item
limit - how many items to return (use 0 for unlimited result)
Throws:
IllegalArgumentException - if any of the integer parameters is lesser than 0


Copyright © 2011 Seam Framework. All Rights Reserved.