Package com.jalios.jcms.db
Class AbstractDBQueryBuilder<T extends DBData>
java.lang.Object
com.jalios.jcms.db.AbstractDBQueryBuilder<T>
- Direct Known Subclasses:
AccessTokenQueryBuilder,BackgroundProcessQueryBuilder,PublicLinkQueryBuilder,TrackerInfoQueryBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Memberprotected booleanprotected org.hibernate.criterion.Orderprotected intprotected intprotected booleanprotected org.hibernate.criterion.Order -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAuthorCriterion(org.hibernate.Criteria criteria) Add the author criterionprotected abstract voidaddCriterions(org.hibernate.Criteria criteria) To override to add the custom criterionorg.hibernate.Criteriabuild()intcount()protected AbstractDBQueryBuildercounting(boolean counting) protected org.hibernate.CriteriacreateCriteria(int firstResult, int maxResults) first()firstResult(int firstResult) list()maxResults(int maxResults) noPaging()Force no paging for this criteriaorderBy(org.hibernate.criterion.Order order) org.hibernate.ScrollableResultsscroll()org.hibernate.ScrollableResultsscroll(org.hibernate.ScrollMode scrollMode, int fetchSize) protected voidsetDefaultOrder(org.hibernate.criterion.Order defaultOrder) Sets the default order to use if no order has been defined.
-
Field Details
-
author
-
firstResult
protected int firstResult -
maxResults
protected int maxResults -
order
protected org.hibernate.criterion.Order order -
defaultOrder
protected org.hibernate.criterion.Order defaultOrder -
counting
protected boolean counting -
noPaging
protected boolean noPaging
-
-
Constructor Details
-
AbstractDBQueryBuilder
public AbstractDBQueryBuilder()
-
-
Method Details
-
getDBDataClass
- Returns:
- the queried DBData class.
- Since:
- jcms-10.0.5
-
setDefaultOrder
protected void setDefaultOrder(org.hibernate.criterion.Order defaultOrder) Sets the default order to use if no order has been defined.- Parameters:
defaultOrder- the default order.- Since:
- jcms-10.0.5
-
author
- Parameters:
author- the author- Returns:
- the PublicLinkQueryBuilder
- Since:
- jcms-10.0.5
-
firstResult
- Parameters:
firstResult- set the first pubLink to retrieve. If <= 0, rows will be retrieved beginning from first pubLink.- Returns:
- the AbstractDBQueryBuilder
- Since:
- jcms-10.0.5
-
maxResults
- Parameters:
maxResults- set the maximum pubLink to retrieve. If < 0, there is no limit to the number of pubLink retrieved.- Returns:
- the AbstractDBQueryBuilder
- Since:
- jcms-10.0.5
-
noPaging
Force no paging for this criteria- Returns:
- the AbstractDBQueryBuilder
- Since:
- jcms-10.0.5
-
orderBy
- Parameters:
order- the order- Returns:
- the AbstractDBQueryBuilder
- Since:
- jcms-10.0.5
-
counting
-
build
public org.hibernate.Criteria build()- Returns:
- the criteria built from the all the criterion, the firstResult, the maxResults and the order.
- Since:
- jcms-10.0.5
-
createCriteria
protected org.hibernate.Criteria createCriteria(int firstResult, int maxResults) -
addCriterions
protected abstract void addCriterions(org.hibernate.Criteria criteria) To override to add the custom criterion- Parameters:
criteria- the Criteria- Since:
- jcms-10.0.5
-
addAuthorCriterion
protected void addAuthorCriterion(org.hibernate.Criteria criteria) Add the author criterion- Parameters:
criteria- the Criteria- Since:
- jcms-10.0.5
-
list
- Returns:
- the list of results
- Since:
- jcms-10.0.5
-
first
- Returns:
- the first result (or null if there is no result)
- Since:
- jcms-10.0.5
-
count
public int count()- Returns:
- the count of result.
- Since:
- jcms-10.0.5
-
scroll
public org.hibernate.ScrollableResults scroll()- Returns:
- a ScrollableResults (FORWARD_ONLY with the default fetch size)
- Since:
- jcms-10.0.5
-
scroll
public org.hibernate.ScrollableResults scroll(org.hibernate.ScrollMode scrollMode, int fetchSize) - Parameters:
scrollMode- the scroll modefetchSize- the fetch size- Returns:
- a ScrollableResults
- Since:
- jcms-10.0.5
-