|
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.search.SearchClassSpecification
A SearchClassSpecification represents the FROM and SELECT clauses of select statement. In iFS Searches always return objects and not attributes. So the select list is a list of classes and not attributes.
For each Searched class users can specify whether subclass objects should be included in the search. The default behavior is to include subclass objects and to exclude deleted objects.
Users can also specify aliases for the searched classes. This is needed on joins on the same class. If a user specifies an alias for a class, then the alias must be used in place of the class in all the Qualifiers, SortSpecifications, and ResultClass lists. Using the className in place of the alias will cause IfsException-22701 to be thrown.
The aliases must be unique within a SearchClassSpecification. Also the same class cannot be specified more than once without an alias. This will cause IfsException-22700 to be thrown.
// Usage Examples // Here we show combination of default constructor and other mutator // methods. Similar results can be achieved using constructor variants, // which take additional parameters. // Simple search class spec with a single class in it. // The single class acts as the result class also. // Generates Select DOCUMENT.* from DOCUMENT SearchClassSpecification searchClassSpec = new SearchClassSpecification(); searchClassSpec.addSearchClass(Document.CLASS_NAME); // Multiple search classes. Remember to use JoinQualification. // Search classes - DOCUMENT, CATEGORY // Result Class - DOCUMENT (picked by default) // SQL - Select DOCUMENT.* from DOCUMENT, CATEGORY SearchClassSpecification searchClassSpec = new SearchClassSpecification(); searchClassSpec.addSearchClass(Document.CLASS_NAME); searchClassSpec.addSearchClass(Category.CLASS_NAME); // Overriding the default result class searchClassSpec.addResultClass(Category.CLASS_NAME); // Using aliases for class names. Aliases very useful when having // same search class more than once in the search class specification. // Search Classes - DOCUMENT, CATEGORY // Search class aliases - DOC, CAT // Result Class - DOCUMENT (Picked by default) // SQL - Select DOC.* from DOCUMENT DOC, CATEGORY CAT SearchClassSpecification searchClassSpec = new SearchClassSpecification(); searchClassSpec.addSearchClass(Document.CLASS_NAME, "DOC"); searchClassSpec.addSearchClass(Category.CLASS_NAME, "CAT"); // Set up to remove duplicates searchClassSpec.setDistinct(true);
Constructor Summary | |
SearchClassSpecification()
Constructs an empty SearchClassSpecification. |
|
SearchClassSpecification(java.lang.String[] sClasses)
Construct SearchClassSpecification, initializing with the set of classes supplied in the parameter. |
|
SearchClassSpecification(java.lang.String[] sClasses,
boolean[] delBehavior,
boolean[] recBehavior)
Construct SearchClassSpecification, initializing it with the supplied set of classes, delete behavior, and recursive behavior. |
|
SearchClassSpecification(java.lang.String[] sClasses,
java.lang.String[] sAliases,
boolean[] delBehavior,
boolean[] recBehavior)
Construct SearchClassSpecification, initializing it with the set of supplied classes, aliases, delete behavior, and recursive behavior. |
Method Summary | |
void |
addResultClass(java.lang.String name)
Add name to the ResultClass list. |
void |
addSearchClass(java.lang.String sClass)
Adds the class to the list of Searched Classes. |
void |
addSearchClass(java.lang.String sClass,
java.lang.String sAlias)
Adds the class to the list of Searched Classes. |
void |
addSearchClasses(java.lang.String[] sClasses)
Add search classes to list of classes. |
void |
addSearchClasses(java.lang.String[] sClasses,
java.lang.String[] sAliases)
add search classes to list of classes. |
java.lang.Object |
clone()
Returns a clone of this SearchClassSpecification. |
boolean[] |
getRecursiveBehavior()
Returns recursive behavior of classes |
java.lang.String[] |
getResultClassnames()
Gets list of result classes |
java.lang.String[] |
getSearchClassAliases()
Gets list of search aliases. |
java.lang.String[] |
getSearchClassnames()
Returns list of search classes |
boolean |
isDistinct()
Get remove duplicates behavior. |
void |
setDistinct(boolean isDistinct)
Set remove duplicates behavior. |
Constructor Detail |
public SearchClassSpecification() throws IfsException
IfsException
- if operation fails.public SearchClassSpecification(java.lang.String[] sClasses) throws IfsException
searchClasses
- list of classes to search over.IfsException
- if operation fails.public SearchClassSpecification(java.lang.String[] sClasses, boolean[] delBehavior, boolean[] recBehavior) throws IfsException
searchClasses
- list of classes to search over.delBehavior
- array of boolean describing delete behavior for each class.recBehavior
- array of boolean describing recursive behavior for each class.IfsException
- if operation fails.public SearchClassSpecification(java.lang.String[] sClasses, java.lang.String[] sAliases, boolean[] delBehavior, boolean[] recBehavior) throws IfsException
sClasses
- list of classes to search over.sAliases
- Aliases for the classesdelBehavior
- array of boolean describing delete behavior for each class.recBehavior
- array of boolean describing recursive behavior for each class.IfsException
- if operation fails.Method Detail |
public void addSearchClasses(java.lang.String[] sClasses) throws IfsException
sClasses
- list of classes.IfsException
- if the operation failspublic void addSearchClasses(java.lang.String[] sClasses, java.lang.String[] sAliases) throws IfsException
sClasses
- list of classes.sAliases
- Aliases for the classes. For unspecified values, alias is
assumed to be null.IfsException
- if operation fails.public void addSearchClass(java.lang.String sClass) throws IfsException
sClass
- the iFS class being searchedIfsException
- if operation fails.public void addSearchClass(java.lang.String sClass, java.lang.String sAlias) throws IfsException
sClass
- the iFS class being searchedsAlias
- the Alias for the Class, if this is null an internal alias
is generated. User must use ClassName in Quals, SortSpec etc.IfsException
- 22702 if sClass is null.public java.lang.String[] getSearchClassnames()
public java.lang.String[] getSearchClassAliases() throws IfsException
IfsException
- if the operation failspublic boolean[] getRecursiveBehavior()
public void addResultClass(java.lang.String name) throws IfsException
name
- For classes w/o aliases, this should be the className; o.w.
this should be the alias.IfsException
- 22701 if name is not validpublic java.lang.String[] getResultClassnames() throws IfsException
IfsException
- if the operation failspublic java.lang.Object clone()
clone
in class java.lang.Object
public void setDistinct(boolean isDistinct) throws IfsException
isDistinct
- if true, add DISTINCT to select clause.IfsException
- if the operation failspublic boolean isDistinct() throws IfsException
IfsException
- if the operation fails
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |