|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.seam.framework.Controller
org.jboss.seam.framework.PersistenceController<T>
org.jboss.seam.framework.Query<T,E>
public abstract class Query<T,E>
Base class for components which manage a query result set. This class may be reused by either configuration or extension, and may be bound directly to a view, or accessed by some intermediate Seam component.
Constructor Summary | |
---|---|
Query()
|
Method Summary | |
---|---|
protected void |
clearDataModel()
|
protected void |
evaluateAllParameters()
|
void |
first()
Move the result set cursor to the beginning of the first page |
protected String |
getCountEjbql()
Return the ejbql to used in a count query (for calculating number of results) |
javax.faces.model.DataModel |
getDataModel()
Wrap the result set in a JSF DataModel
Delegates to DataModels.getDataModel(Query) |
E |
getDataModelSelection()
Get the selected row of the JSF DataModel |
int |
getDataModelSelectionIndex()
Get the index of the selected row of the JSF DataModel |
String |
getEjbql()
|
Integer |
getFirstResult()
Returns the index of the first result of the current page |
String |
getGroupBy()
|
Long |
getLastFirstResult()
Get the index of the first result of the last page |
Integer |
getMaxResults()
The page size |
int |
getNextFirstResult()
Get the index of the first result of the next page |
String |
getOrder()
The order clause of the query |
String |
getOrderColumn()
|
String |
getOrderDirection()
|
Integer |
getPageCount()
Get the total number of pages |
int |
getPreviousFirstResult()
Get the index of the first result of the previous page |
protected List<Expressions.ValueExpression> |
getQueryParameters()
|
protected List<Object> |
getQueryParameterValues()
|
protected String |
getRenderedEjbql()
|
List<String> |
getRestrictionExpressionStrings()
|
String |
getRestrictionLogicOperator()
|
protected List<Expressions.ValueExpression> |
getRestrictionParameters()
|
protected List<Object> |
getRestrictionParameterValues()
|
List<Expressions.ValueExpression> |
getRestrictions()
List of restrictions to apply to the query. |
abstract Long |
getResultCount()
|
abstract List<E> |
getResultList()
|
abstract E |
getSingleResult()
|
protected boolean |
isAnyParameterDirty()
|
abstract boolean |
isNextExists()
Returns true if next page exists |
boolean |
isPaginated()
Returns true if the query is paginated, revealing whether navigation controls are needed. |
boolean |
isPreviousExists()
Returns true if the previous page exists |
protected boolean |
isRestrictionParameterSet(Object parameterValue)
|
protected boolean |
isUseWildcardAsCountQuerySubject()
|
void |
last()
Move the result set cursor to the beginning of the last page |
void |
next()
Move the result set cursor to the beginning of the next page |
protected void |
parseEjbql()
|
void |
previous()
Move the result set cursor to the beginning of the previous page |
void |
refresh()
|
void |
setEjbql(String ejbql)
Set the ejbql to use. |
void |
setFirstResult(Integer firstResult)
Set the index at which the page to display should start |
void |
setGroupBy(String groupBy)
|
void |
setMaxResults(Integer maxResults)
|
void |
setOrder(String order)
|
void |
setOrderColumn(String orderColumn)
|
void |
setOrderDirection(String orderDirection)
|
protected void |
setQueryParameterValues(List<Object> queryParameterValues)
|
void |
setRestrictionExpressionStrings(List<String> expressionStrings)
A convenience method for registering the restrictions from Strings. |
void |
setRestrictionLogicOperator(String operator)
|
protected void |
setRestrictionParameterValues(List<Object> restrictionParameterValues)
|
void |
setRestrictions(List<Expressions.ValueExpression> restrictions)
Calling setRestrictions causes the restrictions to be reparsed and the query refreshed |
protected void |
setUseWildcardAsCountQuerySubject(boolean useCompliantCountQuerySubject)
|
protected List<E> |
truncResultList(List<E> results)
|
void |
validate()
|
Methods inherited from class org.jboss.seam.framework.PersistenceController |
---|
getPersistenceContext, getPersistenceContextName, setPersistenceContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Query()
Method Detail |
---|
public abstract List<E> getResultList()
public abstract E getSingleResult()
public abstract Long getResultCount()
@Create public void validate()
@Transactional public javax.faces.model.DataModel getDataModel()
DataModel
Delegates to DataModels.getDataModel(Query)
public E getDataModelSelection()
DataModel
public int getDataModelSelectionIndex()
DataModel
public void refresh()
@Transactional public void last()
public void next()
public void previous()
public void first()
protected void clearDataModel()
@Transactional public Long getLastFirstResult()
public int getNextFirstResult()
public int getPreviousFirstResult()
@Transactional public Integer getPageCount()
protected void parseEjbql()
protected String getRenderedEjbql()
protected boolean isRestrictionParameterSet(Object parameterValue)
protected String getCountEjbql()
public String getEjbql()
public void setEjbql(String ejbql)
public Integer getFirstResult()
public boolean isPreviousExists()
public abstract boolean isNextExists()
public boolean isPaginated()
public void setFirstResult(Integer firstResult)
public Integer getMaxResults()
public void setMaxResults(Integer maxResults)
public List<Expressions.ValueExpression> getRestrictions()
public void setRestrictions(List<Expressions.ValueExpression> restrictions)
public void setRestrictionExpressionStrings(List<String> expressionStrings)
public List<String> getRestrictionExpressionStrings()
public String getGroupBy()
public void setGroupBy(String groupBy)
public String getOrder()
public void setOrder(String order)
public String getOrderDirection()
public void setOrderDirection(String orderDirection)
public String getOrderColumn()
public void setOrderColumn(String orderColumn)
public String getRestrictionLogicOperator()
public void setRestrictionLogicOperator(String operator)
protected List<Expressions.ValueExpression> getQueryParameters()
protected List<Expressions.ValueExpression> getRestrictionParameters()
protected void evaluateAllParameters()
protected boolean isAnyParameterDirty()
protected List<Object> getQueryParameterValues()
protected void setQueryParameterValues(List<Object> queryParameterValues)
protected List<Object> getRestrictionParameterValues()
protected void setRestrictionParameterValues(List<Object> restrictionParameterValues)
protected List<E> truncResultList(List<E> results)
protected boolean isUseWildcardAsCountQuerySubject()
protected void setUseWildcardAsCountQuerySubject(boolean useCompliantCountQuerySubject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |