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 void
clearTimeout()
QueryOptions
copy()
int
getPageIndex()
Defines which page of results the query is to retrieve.boolean
getPrintSQLBeforeExecution()
DBDatabase
getQueryDatabase()
DBDefinition
getQueryDefinition()
String
getQueryLabel()
QueryType
getQueryType()
String
getRawSQL()
boolean
getRequireEmptyStringForNullString()
int
getRowLimit()
Returns the current row limit.SortProvider[]
getSortColumns()
int
getTimeoutInMilliseconds()
boolean
isBlankQueryAllowed()
boolean
isCartesianJoinAllowed()
boolean
isCreatingNativeQuery()
Used while simulating OUTER JOIN to indicate that the simulation is occurring.boolean
isMatchAllConditions()
Indicates whether this query will use AND rather than OR to add the conditions.boolean
isMatchAllRelationships()
boolean
isMatchAny()
Indicates whether this query will use OR rather than AND to add the conditions.boolean
isUseANSISyntax()
boolean
isUseStarInsteadOfColumns()
void
setBlankQueryAllowed(boolean blankQueryAllowed)
void
setCartesianJoinAllowed(boolean cartesianJoinAllowed)
void
setCreatingNativeQuery(boolean creatingNativeQuery)
Used while simulating OUTER JOIN to indicate that the simulation is occurring.void
setMatchAllConditions()
Changes the DBQuery to using all ANDs to connect the criteriavoid
setMatchAllRelationships()
Controls how relationships, that is Foreign Keys, are compared.void
setMatchAnyConditions()
Changes the DBQuery to using all ORs to connect the criteriavoid
setMatchAnyRelationship()
Controls how relationships, that is Foreign Keys, are compared.void
setPageIndex(int pageIndex)
void
setPrintSQLBeforeExecution(boolean b)
void
setQueryDatabase(DBDatabase db)
void
setQueryLabel(String queryLabel)
void
setQueryType(QueryType queryType)
void
setRawSQL(String rawQuery)
void
setRequireEmptyStringForNullString(boolean requireEmptyStringForNullString)
void
setRowLimit(int rowLimit)
void
setSortColumns(SortProvider[] sortColumns)
void
setTimeoutInMilliseconds(int milliseconds)
void
setTimeoutToForever()
void
setUseANSISyntax(boolean useANSISyntax)
void
setUseStarInsteadOfColumns(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()
-
-