edu.vt.middleware.ed.query
Class AbstractSearchCriteria

java.lang.Object
  extended by edu.vt.middleware.ed.query.AbstractSearchCriteria
All Implemented Interfaces:
SearchCriteria, Serializable
Direct Known Subclasses:
DirectSearchCriteria, EntitlementSearchCriteria, GroupSearchCriteria, PersonSearchCriteria, ServiceSearchCriteria

public abstract class AbstractSearchCriteria
extends Object
implements SearchCriteria, Serializable

Contains methods common to all search criteria.

Version:
$Revision: 7990 $ $Date: 2008-06-23 14:21:22 -0400 (Mon, 23 Jun 2008) $
Author:
Daniel Fisher
See Also:
Serialized Form

Field Summary
private  int firstResult
          first result
private  boolean loadLazyProperties
          load lazy properties
private  int maxResults
          max results
private static String OPERATOR_REGEX
          Regular expression for determining equality operator
private static long serialVersionUID
          Serialization version marker
private  Long uid
          uid
 
Fields inherited from interface edu.vt.middleware.ed.query.SearchCriteria
DEFAULT_MAX_RESULTS, SINGLE_RESULT, UNLIMITED_RESULTS, WS_MAX_RESULTS
 
Constructor Summary
AbstractSearchCriteria()
           
 
Method Summary
protected abstract  String buildEjbQL()
          Builds the EJB-QL using any supplied search criteria.
 String getEjbQL()
          Returns the EJB-QL for this search criteria.
 int getFirstResult()
          This returns the position of the first result to return for this criteria.
 boolean getLoadLazyProperties()
          This returns whether lazy properties should be loaded for all search results.
 int getMaxResults()
          This returns the maximum number of results to return for this criteria.
protected  String getOperator(String input)
          Returns the equality operator for the supplied input.
 Long getUid()
          This returns the uid for the search object.
abstract  boolean isEmpty()
          Returns whether any search criteria exists.
 void setFirstResult(int i)
          This sets the position of the first result to return for this criteria.
 void setLoadLazyProperties(boolean b)
          This sets whether to lazy properties should be loaded for all search results.
 void setMaxResults(int i)
          This sets the maximum number of results to return for this criteria.
 void setUid(Long l)
          This sets the uid for the search object.
 String toString()
          Returns a String representation of this search criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serialization version marker

See Also:
Constant Field Values

OPERATOR_REGEX

private static final String OPERATOR_REGEX
Regular expression for determining equality operator

See Also:
Constant Field Values

uid

private Long uid
uid


maxResults

private int maxResults
max results


firstResult

private int firstResult
first result


loadLazyProperties

private boolean loadLazyProperties
load lazy properties

Constructor Detail

AbstractSearchCriteria

public AbstractSearchCriteria()
Method Detail

getUid

public Long getUid()
This returns the uid for the search object. Returns null if no uid has been set.

Specified by:
getUid in interface SearchCriteria
Returns:
Long

setUid

public void setUid(Long l)
This sets the uid for the search object.

Specified by:
setUid in interface SearchCriteria
Parameters:
l - Long

getMaxResults

public int getMaxResults()
This returns the maximum number of results to return for this criteria.

Specified by:
getMaxResults in interface SearchCriteria
Returns:
int

setMaxResults

public void setMaxResults(int i)
This sets the maximum number of results to return for this criteria.

Specified by:
setMaxResults in interface SearchCriteria
Parameters:
i - int

getFirstResult

public int getFirstResult()
This returns the position of the first result to return for this criteria.

Specified by:
getFirstResult in interface SearchCriteria
Returns:
int

setFirstResult

public void setFirstResult(int i)
This sets the position of the first result to return for this criteria.

Specified by:
setFirstResult in interface SearchCriteria
Parameters:
i - int

getLoadLazyProperties

public boolean getLoadLazyProperties()
This returns whether lazy properties should be loaded for all search results. Default value is true.

Specified by:
getLoadLazyProperties in interface SearchCriteria
Returns:
boolean

setLoadLazyProperties

public void setLoadLazyProperties(boolean b)
This sets whether to lazy properties should be loaded for all search results.

Specified by:
setLoadLazyProperties in interface SearchCriteria
Parameters:
b - boolean

getEjbQL

public String getEjbQL()
Returns the EJB-QL for this search criteria.

Specified by:
getEjbQL in interface SearchCriteria
Returns:
String

toString

public String toString()
Returns a String representation of this search criteria.

Overrides:
toString in class Object
Returns:
String

buildEjbQL

protected abstract String buildEjbQL()
Builds the EJB-QL using any supplied search criteria.

Returns:
String

getOperator

protected String getOperator(String input)
Returns the equality operator for the supplied input.

Parameters:
input - String
Returns:
String

isEmpty

public abstract boolean isEmpty()
Returns whether any search criteria exists.

Specified by:
isEmpty in interface SearchCriteria
Returns:
boolean


Copyright © 2008 Virginia Tech. All Rights Reserved.