Class QueryOptions
- java.lang.Object
-
- nz.co.gregs.dbvolution.internal.query.QueryOptions
-
- All Implemented Interfaces:
Serializable
public class QueryOptions extends Object implements Serializable
- Author:
- Greogry Graham
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryOptions()QueryOptions(QueryOptions opts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearTimeout()QueryOptionscopy()intgetPageIndex()Defines which page of results the query is to retrieve.booleangetPrintSQLBeforeExecution()DBDatabasegetQueryDatabase()DBDefinitiongetQueryDefinition()StringgetQueryLabel()QueryTypegetQueryType()StringgetRawSQL()booleangetRequireEmptyStringForNullString()intgetRowLimit()Returns the current row limit.SortProvider[]getSortColumns()intgetTimeoutInMilliseconds()booleanisBlankQueryAllowed()booleanisCartesianJoinAllowed()booleanisCreatingNativeQuery()Used while simulating OUTER JOIN to indicate that the simulation is occurring.booleanisMatchAllConditions()Indicates whether this query will use AND rather than OR to add the conditions.booleanisMatchAllRelationships()booleanisMatchAny()Indicates whether this query will use OR rather than AND to add the conditions.booleanisUseANSISyntax()booleanisUseStarInsteadOfColumns()voidsetBlankQueryAllowed(boolean blankQueryAllowed)voidsetCartesianJoinAllowed(boolean cartesianJoinAllowed)voidsetCreatingNativeQuery(boolean creatingNativeQuery)Used while simulating OUTER JOIN to indicate that the simulation is occurring.voidsetMatchAllConditions()Changes the DBQuery to using all ANDs to connect the criteriavoidsetMatchAllRelationships()Controls how relationships, that is Foreign Keys, are compared.voidsetMatchAnyConditions()Changes the DBQuery to using all ORs to connect the criteriavoidsetMatchAnyRelationship()Controls how relationships, that is Foreign Keys, are compared.voidsetPageIndex(int pageIndex)voidsetPrintSQLBeforeExecution(boolean b)voidsetQueryDatabase(DBDatabase db)voidsetQueryLabel(String queryLabel)voidsetQueryType(QueryType queryType)voidsetRawSQL(String rawQuery)voidsetRequireEmptyStringForNullString(boolean requireEmptyStringForNullString)voidsetRowLimit(int rowLimit)voidsetSortColumns(SortProvider[] sortColumns)voidsetTimeoutInMilliseconds(int milliseconds)voidsetTimeoutToForever()voidsetUseANSISyntax(boolean useANSISyntax)voidsetUseStarInsteadOfColumns(boolean useStarInsteadOfColumns)
-
-
-
Constructor Detail
-
QueryOptions
public QueryOptions()
-
QueryOptions
public QueryOptions(QueryOptions opts)
-
-
Method Detail
-
isMatchAllConditions
public boolean isMatchAllConditions()
Indicates whether this query will use AND rather than OR to add the conditions.- Returns:
- TRUE if criteria should be collected using AND
-
isMatchAny
public boolean isMatchAny()
Indicates whether this query will use OR rather than AND to add the conditions.- Returns:
- TRUE if criteria should be collected using OR
-
setMatchAllConditions
public void setMatchAllConditions()
Changes the DBQuery to using all ANDs to connect the criteria
-
setMatchAnyConditions
public void setMatchAnyConditions()
Changes the DBQuery to using all ORs to connect the criteria
-
getRowLimit
public int getRowLimit()
Returns the current row limit.The value will be -1 if no row limit is set.
- Returns:
- the rowLimit
-
setRowLimit
public final void setRowLimit(int rowLimit)
- Parameters:
rowLimit- the rowLimit to set
-
getSortColumns
public SortProvider[] getSortColumns()
- Returns:
- the sortColumns
-
setSortColumns
public final void setSortColumns(SortProvider[] sortColumns)
- Parameters:
sortColumns- the sortColumns to set
-
isBlankQueryAllowed
public boolean isBlankQueryAllowed()
- Returns:
- the blankQueryAllowed
-
setBlankQueryAllowed
public final void setBlankQueryAllowed(boolean blankQueryAllowed)
- Parameters:
blankQueryAllowed- the blankQueryAllowed to set
-
isUseANSISyntax
public boolean isUseANSISyntax()
- Returns:
- the useANSISyntax
-
setUseANSISyntax
public final void setUseANSISyntax(boolean useANSISyntax)
- Parameters:
useANSISyntax- the useANSISyntax to set
-
isCartesianJoinAllowed
public boolean isCartesianJoinAllowed()
- Returns:
- the cartesianJoinAllowed
-
setCartesianJoinAllowed
public final void setCartesianJoinAllowed(boolean cartesianJoinAllowed)
- Parameters:
cartesianJoinAllowed- the cartesianJoinAllowed to set
-
getPageIndex
public int getPageIndex()
Defines which page of results the query is to retrieve.getRowLimit()defines the size of a page, and this method return which page is to be retrieved.Be default the page index is zero.
The first item on the page will be (pageindex*rowlimit) , and the first item on the next page will be ((pageindex+1)*rowlimit).
- Returns:
- the pageIndex
-
setPageIndex
public final void setPageIndex(int pageIndex)
- Parameters:
pageIndex- the pageIndex to set
-
setMatchAnyRelationship
public void setMatchAnyRelationship()
Controls how relationships, that is Foreign Keys, are compared.If there are multiple FKs between 2 DBRows setMatchAnyRelationship() will switch the query to connecting the 2 rows if ANY of the FKs match, rather the normal case of ALL.
-
setMatchAllRelationships
public void setMatchAllRelationships()
Controls how relationships, that is Foreign Keys, are compared.If there are multiple FKs between 2 DBRows setMatchAllRelationship() will switch the query to connecting the 2 rows if ALL of the FKs match.
This is the default option.
-
isMatchAllRelationships
public boolean isMatchAllRelationships()
- Returns:
- the matchAllRelationship
-
isCreatingNativeQuery
public boolean isCreatingNativeQuery()
Used while simulating OUTER JOIN to indicate that the simulation is occurring.- Returns:
- TRUE if the query is native, FALSE otherwise
-
setCreatingNativeQuery
public final void setCreatingNativeQuery(boolean creatingNativeQuery)
Used while simulating OUTER JOIN to indicate that the simulation is occurring.- Parameters:
creatingNativeQuery- the setting required
-
getQueryType
public QueryType getQueryType()
-
setQueryType
public final void setQueryType(QueryType queryType)
-
setQueryDatabase
public final void setQueryDatabase(DBDatabase db)
-
getQueryDatabase
public DBDatabase getQueryDatabase()
-
getQueryDefinition
public DBDefinition getQueryDefinition()
-
setPrintSQLBeforeExecution
public void setPrintSQLBeforeExecution(boolean b)
-
getPrintSQLBeforeExecution
public boolean getPrintSQLBeforeExecution()
-
getRequireEmptyStringForNullString
public boolean getRequireEmptyStringForNullString()
- Returns:
- the requireEmptyStringForNullString
-
setRequireEmptyStringForNullString
public final void setRequireEmptyStringForNullString(boolean requireEmptyStringForNullString)
- Parameters:
requireEmptyStringForNullString- the requireEmptyStringForNullString to set
-
setRawSQL
public void setRawSQL(String rawQuery)
-
getRawSQL
public String getRawSQL()
-
setTimeoutInMilliseconds
public void setTimeoutInMilliseconds(int milliseconds)
-
clearTimeout
public void clearTimeout()
-
setTimeoutToForever
public void setTimeoutToForever()
-
setQueryLabel
public void setQueryLabel(String queryLabel)
-
getQueryLabel
public String getQueryLabel()
-
getTimeoutInMilliseconds
public int getTimeoutInMilliseconds()
-
isUseStarInsteadOfColumns
public boolean isUseStarInsteadOfColumns()
-
setUseStarInsteadOfColumns
public final void setUseStarInsteadOfColumns(boolean useStarInsteadOfColumns)
-
copy
public QueryOptions copy()
-
-