|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.beans.Selector
The Selector class creates and executes SIMPLE searches. The search is
simple because it only searches one class (no "joins" are supported).
A search is performed by constructing a Selector object,
setting the search class and
search selection, then calling getItems()
to run the query.
The search class represents a Library class type, i.e. FOLDER.
The search selection takes the form of a SQL WHERE clause (without
the word "WHERE").
In addition, the sort order defines the manner in
which the query is sorted. Lastly, the RecursiveSearch option determines
whether or not sublcasses are searched as well.
The search results will be locally cached, and a call to resetItems()
is required before the query will be executed again. Calls to item attribute,
sort order, selection and class methods will all clear the cache automatically.
Query results are accessed by using the JavaBeans compliant getItems()
methods, or by using the openItems(), nextItems(), closeItems()
methods.
Using only nextItem() to access selected objects keeps the memory footprint of the selector class low, as it does not cache any objects. When you have potentially large number of objects selected, use nextItem() style of access.
If you use getItems() or getItems(index), the Selector class starts caching the fetched objects in memory. Use this as a convenience when you are certain that the number of selected objects will be a small.
Mixing nextItem() style of access with getItems() style is to be avoided. In case of mixed style access, the Selector class falls back to getItems() mode of operation, where it starts caching all fetched results.
Note that instances of this class do not persist. If you wish to use the same selector in more than one session, consider using a SelectorObject, which can be saved.
SelectorObject
,
SelectorObjectDefinition
Constructor Summary | |
Selector(LibrarySession session)
Construct a Selector object. |
Method Summary | |
void |
closeItems()
Closes the search after cursor based access. |
int |
getItemCount()
Returns the number of items in the search results. |
LibraryObject[] |
getItems()
Returns the entire search results as an array. |
LibraryObject |
getItems(int index)
Returns a single search result item from the search results with an index relative the the search sort order. |
java.lang.String |
getSearchClassname()
Returns the search class. |
java.lang.String |
getSearchSelection()
Returns the search selection. |
SortSpecification |
getSortSpecification()
Returns the Sort Specification |
boolean |
isRecursiveSearch()
Returns true if recursive searching is enabled with respect to classes (i.e., true if this selector will search all subclasses of the specific class). |
LibraryObject |
nextItem()
Gets the next item using an open cursor on the search. |
void |
openItems()
Opens a cursor on this Search ready for reading search results. |
void |
resetItems()
Clears locally stored search results. |
void |
setRecursiveSearch(boolean recursive)
Enables/disables recursive searching with respect to classes. |
void |
setSearchClassname(java.lang.String searchClass)
Sets the search class. |
void |
setSearchSelection(java.lang.String searchSelection)
Sets the search selection. |
void |
setSortSpecification(SortSpecification spec)
Sets the Sort Specification |
Constructor Detail |
public Selector(LibrarySession session) throws IfsException
session
- the current session.IfsException
- if operation fails.Method Detail |
public java.lang.String getSearchClassname() throws IfsException
IfsException
- if operation fails.public void setSearchClassname(java.lang.String searchClass) throws IfsException
searchClass
- the search class.IfsException
- if operation fails.public java.lang.String getSearchSelection() throws IfsException
IfsException
- if operation fails.public void setSearchSelection(java.lang.String searchSelection) throws IfsException
searchSelection
- the search selection.IfsException
- if operation fails.public boolean isRecursiveSearch() throws IfsException
IfsException
- if the operation fails.public void setRecursiveSearch(boolean recursive) throws IfsException
recursive
- true for enabled.IfsException
- if the operation fails.public SortSpecification getSortSpecification() throws IfsException
IfsException
- if the operation fails.public void setSortSpecification(SortSpecification spec) throws IfsException
the
- sort specification.IfsException
- if the operation fails.public LibraryObject[] getItems() throws IfsException
IfsException
- if operation fails.public LibraryObject getItems(int index) throws IfsException, java.lang.IndexOutOfBoundsException
index
- the index of a search result.IfsException
- if operation fails.java.lang.IndexOutOfBoundsException
- if the index is greater than the
number of items in the search.public int getItemCount() throws IfsException
IfsException
- if operation fails.public void openItems() throws IfsException
IfsException
- if the operation fails.closeItems()
public LibraryObject nextItem() throws IfsException
IfsException
- 22000 if no more items, or other
error code if the operation fails.public void closeItems() throws IfsException
IfsException
- if the operation fails.public void resetItems() throws IfsException
IfsException
- if operation fails.
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |