fr.ifremer.allegro
Class Search

java.lang.Object
  extended by fr.ifremer.allegro.Search
All Implemented Interfaces:
java.io.Serializable

public class Search
extends java.lang.Object
implements java.io.Serializable

Stores the information necessary to performa a property search.

See Also:
PropertySearch, Serialized Form

Constructor Summary
Search()
          Constructs the search object.
Search(SearchParameter[] parameters)
          Constructs the search object.
Search(SearchParameter[] parameters, boolean eagerFetching)
          Constructs the search object.
Search(SearchParameter[] parameters, int pageNumber, int pageSize)
          Constructs the search object.
Search(SearchParameter[] parameters, int pageNumber, int pageSize, boolean eagerFetching)
          Constructs the search object.
 
Method Summary
 Search addOrderBy(java.lang.String propertyName)
          Adds an "order by" clause for the search with default ascending order.
 Search addOrderBy(java.lang.String propertyName, boolean descending)
          Adds an "order by" clause for the search.
 Search addOrderBy(java.lang.String propertyName, int order)
          Adds an "order by" clause for the search.
 Search addSearchParameter(SearchParameter searchParameter)
          Adds a search parameter to the search.
 int getPageNumber()
          Gets the page number (if paging the results).
 int getPageSize()
          Gets the size of the page (if paging the results).
 SearchParameter[] getParameters()
          Gets the search parameters for this search object..
 boolean isEagerFetching()
          Whether or not eager fetching is enabled (if it is enabled, all associations queried will be fetched eagerly).
 boolean isUseSqlLimiting()
          Whether or not to use sql limiting (if paging is being used).
 Search setEagerFetching(boolean eagerFetching)
          Sets whether or not eager fetching is enabled (if it is enabled, all associations queried will be fetched eagerly).
 Search setPageNumber(int pageNumber)
          Sets the page number (if paging the results).
 Search setPageSize(int pageSize)
          Sets the size of the page (if paging the results).
 Search setParameters(SearchParameter[] parameters)
          Sets the search parameters for this search object.
 Search setUseSqlLimiting(boolean useSqlPaging)
          Sets whether or not to use sql limiting (if paging is being used).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Search

public Search(SearchParameter[] parameters,
              int pageNumber,
              int pageSize,
              boolean eagerFetching)
Constructs the search object.

Parameters:
parameters - the parameters to use.
pageNumber - the page number (if paging results).
pageSize - the page size (if paging results).
eagerFetching - whether or not the search will eagerly fetch the associations included in the search.

Search

public Search(SearchParameter[] parameters,
              int pageNumber,
              int pageSize)
Constructs the search object.

Parameters:
parameters - the parameters to use.
pageNumber - the page number (if paging results).
pageSize - the page size (if paging results).

Search

public Search(SearchParameter[] parameters)
Constructs the search object.

Parameters:
parameters - the parameters to use.

Search

public Search(SearchParameter[] parameters,
              boolean eagerFetching)
Constructs the search object.

Parameters:
parameters - the parameters to use.

Search

public Search()
Constructs the search object.

Parameters:
parameters - the parameters to use.
Method Detail

getPageNumber

public int getPageNumber()
Gets the page number (if paging the results).

Returns:
the page number.

setPageNumber

public Search setPageNumber(int pageNumber)
Sets the page number (if paging the results).

Returns:
the current search instance.

getPageSize

public int getPageSize()
Gets the size of the page (if paging the results).

Returns:
the page size.

setPageSize

public Search setPageSize(int pageSize)
Sets the size of the page (if paging the results).

Parameters:
pageSize - the page size.
Returns:
the current search instance.

getParameters

public SearchParameter[] getParameters()
Gets the search parameters for this search object..


setParameters

public Search setParameters(SearchParameter[] parameters)
Sets the search parameters for this search object.

Parameters:
parameters -
returns - the current search instance.

addSearchParameter

public Search addSearchParameter(SearchParameter searchParameter)
Adds a search parameter to the search.

Parameters:
searchParameter - the search parameter to add.
Returns:
the current search instance.

isEagerFetching

public boolean isEagerFetching()
Whether or not eager fetching is enabled (if it is enabled, all associations queried will be fetched eagerly).

Returns:
true/false

setEagerFetching

public Search setEagerFetching(boolean eagerFetching)
Sets whether or not eager fetching is enabled (if it is enabled, all associations queried will be fetched eagerly).

Parameters:
eagerFetching - whether or not to eager fetch the results.
Returns:
the current search instance.

addOrderBy

public Search addOrderBy(java.lang.String propertyName)
Adds an "order by" clause for the search with default ascending order.

Parameters:
propertyName - the property name to order by.
Returns:
the current search instance.

addOrderBy

public Search addOrderBy(java.lang.String propertyName,
                         int order)
Adds an "order by" clause for the search.

Parameters:
propertyName - the property name to order by.
order - the order. Use: SearchParameter.ORDER_ASC, SearchParameter.ORDER_DESC, or SearchParameter.ORDER_UNSET.
Returns:
the current search instance.

addOrderBy

public Search addOrderBy(java.lang.String propertyName,
                         boolean descending)
Adds an "order by" clause for the search.

Parameters:
propertyName - the property name to order by.
descending - true/false; true for descending ordering, false for ascending ordering.
Returns:
the current search instance.

isUseSqlLimiting

public boolean isUseSqlLimiting()
Whether or not to use sql limiting (if paging is being used). If this is set to false, then paging will be based on the actual entities returned instead of using SQL to limit the results.

Returns:
true/false

setUseSqlLimiting

public Search setUseSqlLimiting(boolean useSqlPaging)
Sets whether or not to use sql limiting (if paging is being used). If this is set to false, then paging will be based on the actual entities returned instead of using SQL to limit the results.

Parameters:
useSqlPaging - whether or not to use SQL paging (default is false).
Returns:
the current search instance.


Copyright © 2008-2010 IFREMER. All Rights Reserved.