public class BrowseDAOPostgres extends Object implements BrowseDAO
Constructor and Description |
---|
BrowseDAOPostgres(Context context)
Required constructor for use by BrowseDAOFactory
|
Modifier and Type | Method and Description |
---|---|
int |
doCountQuery()
This executes a query which will count the number of results for the
parameters you set.
|
int |
doDistinctOffsetQuery(String column,
String value,
boolean isAscending)
This executes a query which returns the offset where the value (or nearest greater
equivalent) can be found in the specified table ordered by the column.
|
String |
doMaxQuery(String column,
String table,
int itemID)
This executes a query which returns the value of the "highest" (max) value
in the given table's column for the given item id.
|
int |
doOffsetQuery(String column,
String value,
boolean isAscending)
This executes a query which returns the offset where the value (or nearest greater
equivalent) can be found in the specified table ordered by the column.
|
List<BrowseItem> |
doQuery()
This executes a query which returns a List object containing BrowseItem objects
representing the results of a full item browse.
|
List<String[]> |
doValueQuery()
This executes a query which returns a List object containing String
values which represent the results of a single value browse (for
example, the list of all subject headings).
|
String |
getAuthorityValue() |
int |
getContainerID()
Get the database ID of the container object.
|
String |
getContainerIDField()
get the name of the field in which to look for the container id.
|
String |
getContainerTable()
Get the name of the container table that is being used to map items to distinct
values when in a container constrained browse
|
String[] |
getCountValues()
Get the array of fields that we will be counting on.
|
String |
getFilterValue()
Get the value which we are constraining all our browse results to contain.
|
String |
getFilterValueField()
Get the name of the field in which the value to constrain results is
contained
|
String |
getJumpToField()
Get the field in which we will match a focus value from which to start
the browse.
|
String |
getJumpToValue()
Get the value at which the browse will start.
|
int |
getLimit()
get the integer number which is the limit of the results that will be returned
by any query.
|
int |
getOffset()
Get the offset from the first result from which to return results.
|
String |
getOrderField()
Get the database field which will be used to do the sorting of result sets on.
|
String[] |
getSelectValues()
Get the array of values that we will be selecting on.
|
String |
getTable()
get the name of the table that we are querying
|
boolean |
isAscending()
Is the sort order ascending or descending?
|
boolean |
isDistinct()
Is this a distinct value browse?
|
boolean |
isEnableBrowseFrequencies() |
void |
setAscending(boolean ascending)
Set whether the results should be sorted in ascending order (on the given sort column)
or descending order.
|
void |
setAuthorityValue(String value) |
void |
setContainerID(int containerID)
Set the database id of the container object.
|
void |
setContainerIDField(String containerIDField)
set the name of the field in which to look for the container id.
|
void |
setContainerTable(String containerTable)
If we have specified a container id and container field, we must also specify
a container table.
|
void |
setCountValues(String[] fields)
Set the array of columns that we will be counting over.
|
void |
setDistinct(boolean bool)
Set whether this is a distinct value browse or not
|
void |
setEnableBrowseFrequencies(boolean enableBrowseFrequencies) |
void |
setEqualsComparator(boolean equalsComparator)
Set whether the query should use an equals comparator when doing less than or
greater than comparisons.
|
void |
setFilterMappingTables(String tableDis,
String tableMap)
Set the name of the mapping tables to use for filtering
|
void |
setFilterValue(String value)
Set the value to which all our browse results should be constrained.
|
void |
setFilterValueField(String valueField)
Set he name of the field in which the value to constrain results is
contained
|
void |
setFilterValuePartial(boolean part)
Sets whether we will treat the filter value as partial (like match), or exact
|
void |
setJumpToField(String focusField)
Set the focus field upon which we will match a value from which to start
the browse.
|
void |
setJumpToValue(String focusValue)
Set the value upon which to start the browse from.
|
void |
setLimit(int limit)
Set the limit for how many results should be returned.
|
void |
setOffset(int offset)
Get the offset from the first result from which to return results.
|
void |
setOrderField(String orderField)
Set the database field which will be used to sort result sets on
|
void |
setSelectValues(String[] selectValues)
Set the array of values to select on.
|
void |
setTable(String table)
Set the name of the table to query
|
boolean |
useEqualsComparator()
Does the query use the equals comparator when doing less than or greater than
comparisons.
|
public BrowseDAOPostgres(Context context) throws BrowseException
context
- DSpace contextBrowseException
public int doCountQuery() throws BrowseException
BrowseDAO
doCountQuery
in interface BrowseDAO
BrowseException
public String doMaxQuery(String column, String table, int itemID) throws BrowseException
BrowseDAO
doMaxQuery
in interface BrowseDAO
column
- the column to interrogatetable
- the table to queryitemID
- the item idBrowseException
public int doOffsetQuery(String column, String value, boolean isAscending) throws BrowseException
BrowseDAO
doOffsetQuery
in interface BrowseDAO
column
- the column to interrogatevalue
- the item idisAscending
- browsing in ascending or descending orderBrowseException
public int doDistinctOffsetQuery(String column, String value, boolean isAscending) throws BrowseException
BrowseDAO
doDistinctOffsetQuery
in interface BrowseDAO
column
- the column to interrogatevalue
- the item idisAscending
- browsing in ascending or descending orderBrowseException
public List<BrowseItem> doQuery() throws BrowseException
BrowseDAO
doQuery
in interface BrowseDAO
BrowseException
public List<String[]> doValueQuery() throws BrowseException
BrowseDAO
doValueQuery
in interface BrowseDAO
BrowseException
public int getContainerID()
BrowseDAO
getContainerID
in interface BrowseDAO
public String getContainerIDField()
BrowseDAO
getContainerIDField
in interface BrowseDAO
public String getContainerTable()
BrowseDAO
getContainerTable
in interface BrowseDAO
public String[] getCountValues()
BrowseDAO
getCountValues
in interface BrowseDAO
public String getJumpToField()
BrowseDAO
getJumpToField
in interface BrowseDAO
public String getJumpToValue()
BrowseDAO
getJumpToValue
in interface BrowseDAO
public int getLimit()
BrowseDAO
public int getOffset()
BrowseDAO
public String getOrderField()
BrowseDAO
getOrderField
in interface BrowseDAO
public String[] getSelectValues()
BrowseDAO
getSelectValues
in interface BrowseDAO
public String getTable()
BrowseDAO
public String getFilterValue()
BrowseDAO
getFilterValue
in interface BrowseDAO
public String getFilterValueField()
BrowseDAO
getFilterValueField
in interface BrowseDAO
public boolean isAscending()
BrowseDAO
isAscending
in interface BrowseDAO
public boolean isDistinct()
BrowseDAO
isDistinct
in interface BrowseDAO
public void setAscending(boolean ascending)
BrowseDAO
setAscending
in interface BrowseDAO
ascending
- true to ascend, false to descendpublic void setContainerID(int containerID)
BrowseDAO
setContainerID
in interface BrowseDAO
public void setContainerIDField(String containerIDField)
BrowseDAO
setContainerIDField
in interface BrowseDAO
containerIDField
- the name of the container id field.
For example "collection_id" or "community_id"public void setContainerTable(String containerTable)
BrowseDAO
setContainerTable
in interface BrowseDAO
containerTable
- the name of the container table mappingpublic void setCountValues(String[] fields)
BrowseDAO
setCountValues
in interface BrowseDAO
fields
- an array of fields to be counted overpublic void setDistinct(boolean bool)
BrowseDAO
setDistinct
in interface BrowseDAO
bool
- true if distinct value, false if notpublic void setEqualsComparator(boolean equalsComparator)
BrowseDAO
setEqualsComparator
in interface BrowseDAO
equalsComparator
- true to use, false to not.public void setJumpToField(String focusField)
BrowseDAO
setJumpToField
in interface BrowseDAO
public void setJumpToValue(String focusValue)
BrowseDAO
setJumpToValue
in interface BrowseDAO
focusValue
- the value in the focus field on which to start browsingpublic void setLimit(int limit)
BrowseDAO
public void setOffset(int offset)
BrowseDAO
public void setOrderField(String orderField)
BrowseDAO
setOrderField
in interface BrowseDAO
orderField
- the field by which results will be sortedpublic void setSelectValues(String[] selectValues)
BrowseDAO
setSelectValues
in interface BrowseDAO
selectValues
- the values to select onpublic void setTable(String table)
BrowseDAO
public void setFilterMappingTables(String tableDis, String tableMap)
BrowseDAO
setFilterMappingTables
in interface BrowseDAO
tableDis
- the name of the table holding the distinct valuestableMap
- the name of the table holding the mappingspublic void setFilterValue(String value)
BrowseDAO
setFilterValue
in interface BrowseDAO
value
- the value to which to constrain resultspublic void setFilterValuePartial(boolean part)
BrowseDAO
setFilterValuePartial
in interface BrowseDAO
part
- true if partial, false if exactpublic void setFilterValueField(String valueField)
BrowseDAO
setFilterValueField
in interface BrowseDAO
valueField
- the name of the fieldpublic boolean useEqualsComparator()
BrowseDAO
useEqualsComparator
in interface BrowseDAO
public void setAuthorityValue(String value)
setAuthorityValue
in interface BrowseDAO
public String getAuthorityValue()
getAuthorityValue
in interface BrowseDAO
public boolean isEnableBrowseFrequencies()
isEnableBrowseFrequencies
in interface BrowseDAO
public void setEnableBrowseFrequencies(boolean enableBrowseFrequencies)
setEnableBrowseFrequencies
in interface BrowseDAO
Copyright © 2016 DuraSpace. All Rights Reserved.