public class S_LibraryObjectSelector extends Object
S_LibraryObject
Modifier and Type | Field and Description |
---|---|
protected Long |
m_ClassId |
protected SortSpecification |
m_IdSortSpecification |
protected SortSpecification |
m_NameSortSpecification |
protected S_LibrarySession |
m_Session |
Modifier | Constructor and Description |
---|---|
protected |
S_LibraryObjectSelector(S_LibrarySession session,
Long classId)
Constructs a S_LibraryObjectSelector object, with the classId
that it is servicing specified.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeCursor(S_LibraryObjectCursor cursor)
Best effort to close a cursor.
|
protected void |
ensureDefaultClass(SortSpecification sort)
Ensure that the specified SortSpecification has
a valid default class set.
|
protected S_LibraryObjectData |
findObjectById(Long id)
Find an object by ID.
|
protected String |
generateStatementName(String classname,
SortSpecification sort,
String stmtSuffix)
Generates a statement name.
|
protected String |
generateStatementName(String classname,
String stmtSuffix)
Generates a statement name.
|
protected String |
generateStatementName(String classname,
String relname,
SortSpecification sort,
String stmtSuffix)
Generates a statement name.
|
protected String |
generateStatementName(String classname,
String relname,
String stmtSuffix)
Generates a statement name.
|
protected S_ClassObjectData |
getClassData()
Gets the Data object.
|
protected S_ClassObjectData |
getClassData(Long classId)
Gets the ClassData object for the specified class ID.
|
protected Long |
getClassId()
Gets the ID of the class this selector is servicing.
|
protected String |
getClassName()
Get the class's name that this instance services.
|
protected LibraryQueryStatement |
getComplexQueryStatement(String key,
LibraryConnection lconn,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String[] bypassSecAliases,
String joinCondition,
String whereClause,
SortSpecification sort,
String hint,
int maxCopies,
boolean countOnly,
int maxItemCount)
Gets a statement for a complex query.
|
protected LibraryQueryStatement |
getComplexQueryStatement(String key,
LibraryConnection lconn,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String whereClause,
SortSpecification sort,
String hint,
int maxCopies,
boolean countOnly)
Gets a statement for a complex query.
|
protected long |
getCountFromResultSet(ResultSet rset)
Gets the count from a ResultSet opened with "select count()" query.
|
protected SortSpecification |
getIdSortSpecification()
Returns the ID Sort Specification to be used
by this selector.
|
protected SortSpecification |
getNameSortSpecification()
Returns the Name Sort Specification to be used
by this selector.
|
protected String |
getResourceString(String key)
Returns a resource string from the Resource Bundle.
|
protected LibraryQueryStatement |
getSearchResultQueryStatement(String key,
LibraryConnection lconn,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
ColumnDescriptor[] colDescs,
String[] bypassSecAliases,
String joinCondition,
String whereClause,
SortSpecification sort,
String hint,
int maxCopies,
int maxItemCount)
Gets a statement for a query for "search results",
meaning specific columns are selected from the specified
search targets.
|
protected S_LibraryService |
getService()
Returns the S_LibraryService which created
the S_LibrarySession from which this object was created.
|
protected LibraryQueryStatement |
getSimpleCountQueryStatement(String key,
LibraryConnection lconn,
String whereClause,
int maxCopies)
Gets a statement for a simple "select count()" query.
|
protected LibraryQueryStatement |
getSimpleQueryStatement(String key,
LibraryConnection lconn,
String whereClause,
SortSpecification sort,
int maxCopies)
Gets a statement for a simple query.
|
protected String |
getStatementSuffix()
Returns a statement suffix appropriate to the current
session Admin mode.
|
protected S_LibraryObjectData |
nextItem(S_LibraryObjectCursor cursor)
Gets the next item from a cursor.
|
protected Vector |
selectAllObjects()
Select all objects.
|
protected Vector |
selectArrayReferencingObjects(AttributeValue referencedValue,
Long attributeId,
SortSpecification sort)
Selects objects based an array attribute referencing the specified object.
|
protected long |
selectArrayReferencingObjectsCount(AttributeValue referencedValue,
Long attributeId)
Selects the count based an array attribute referencing the specified object.
|
protected S_LibraryObjectCursor |
selectArrayReferencingObjectsCursor(AttributeValue referencedValue,
Long attributeId,
SortSpecification sort)
Selects cursor for query based an array attribute referencing the
specified object.
|
protected long |
selectCount(String whereClause)
Perform a "select count()" query.
|
protected long |
selectCount(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String[] bypassSecAliases,
String joinCondition,
String whereClause,
String hint,
AttributeValue[] bindValues)
Perform a complex "select count()" query for S_PreparedSelector.
|
protected long |
selectCount(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String whereClause,
String hint,
AttributeValue[] bindValues)
Perform a complex "select count()" query for S_PreparedSelector.
|
protected long |
selectCount(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String joinCondition,
String whereClause,
String hint,
AttributeValue[] bindValues)
Perform a complex "select count()" query for S_PreparedSelector.
|
protected S_LibraryObjectData |
selectObjectById(Long id)
Selects an object by ID.
|
protected Vector |
selectObjects(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String[] bypassSecAliases,
String joinCondition,
String whereClause,
SortSpecification sort,
int maxItemCount,
int rowNumber,
String language,
String hint,
AttributeValue[] bindValues)
Select objects for a S_PreparedSelector.
|
protected Vector |
selectObjects(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String whereClause,
SortSpecification sort,
int maxItemCount,
int rowNumber,
String language,
AttributeValue[] bindValues)
Select objects for a S_PreparedSelector.
|
protected Vector |
selectObjects(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String whereClause,
SortSpecification sort,
int maxItemCount,
int rowNumber,
String language,
String hint,
AttributeValue[] bindValues)
Select objects for a S_PreparedSelector.
|
protected Vector |
selectObjects(String key,
boolean distinct,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
String joinCondition,
String whereClause,
SortSpecification sort,
int maxItemCount,
int rowNumber,
String language,
String hint,
AttributeValue[] bindValues)
Select objects for a S_PreparedSelector.
|
protected Vector |
selectObjects(String whereClause,
SortSpecification sort)
Select objects for a one-time use S_Selector.
|
protected Vector |
selectObjects(String whereClause,
SortSpecification sort,
int maxItemCount)
Select objects for a one-time use S_Selector.
|
Vector |
selectObjectsByMasterId(Long masterId,
String masterAttrName,
SortSpecification sort)
Selects objects for a detail table, using the specified master ID.
|
protected Vector |
selectObjectsByStringAttribute(String attrValue,
String masterAttrName,
SortSpecification sort)
Selects objects by a String attribute.
|
protected long |
selectObjectsCountByMasterId(Long masterId,
String masterAttrName)
Selects count of objects by master ID.
|
protected S_LibraryObjectCursor |
selectObjectsCursor(String whereClause,
SortSpecification sort)
Open a cursor.
|
protected S_LibraryObjectCursor |
selectObjectsCursorByMasterId(Long masterId,
String masterAttrName,
SortSpecification sort)
Selects cursor for selecting objects by master ID.
|
protected S_LibraryObjectCursor |
selectObjectsCursorByStringAttribute(String attrValue,
String masterAttrName,
SortSpecification sort)
Selects cursor for selecting objects by string attribute.
|
protected boolean |
selectObjectsExistByMasterId(Long masterId,
String masterAttrName)
Checks for the existence of an object by master ID.
|
protected AttributeValueTable[] |
selectResults(String key,
AttributeValue searchTarget,
AttributeValue[] auxTargets,
ColumnDescriptor[] colDescs,
String[] bypassSecAliases,
String joinCondition,
String whereClause,
SortSpecification sort,
int maxItemCount,
int rowNumber,
String language,
String hint,
AttributeValue[] bindValues)
Select results for a S_PreparedSelector.
|
protected S_LibrarySession m_Session
protected Long m_ClassId
protected SortSpecification m_IdSortSpecification
protected SortSpecification m_NameSortSpecification
protected S_LibraryObjectSelector(S_LibrarySession session, Long classId) throws IfsException
session
- session contextclassId
- the class Id that the selector is servingIfsException
- if the operation failsprotected Long getClassId()
protected S_ClassObjectData getClassData() throws IfsException
IfsException
- if operation fails.protected S_ClassObjectData getClassData(Long classId) throws IfsException
classId
- the class IDIfsException
- if operation fails.protected String getClassName() throws IfsException
IfsException
- if operation fails.protected S_LibraryService getService() throws IfsException
IfsException
- if operation fails.protected String getResourceString(String key) throws MissingResourceException, IfsException
MissingResourceException
- if the String cannot be found.IfsException
- if operation fails.protected SortSpecification getNameSortSpecification() throws IfsException
IfsException
- if operation fails.protected SortSpecification getIdSortSpecification() throws IfsException
IfsException
- if operation fails.protected void ensureDefaultClass(SortSpecification sort) throws IfsException
sort
- a Sort specificationIfsException
- if operation fails.protected Vector selectAllObjects() throws IfsException
IfsException
- if operation fails.protected Vector selectObjects(String whereClause, SortSpecification sort) throws IfsException
Indicates no constraint for the maximum item count.
whereClause
- select where clausesort
- the sort specificationIfsException
- if the operation fails.protected Vector selectObjects(String whereClause, SortSpecification sort, int maxItemCount) throws IfsException
whereClause
- select where clausesort
- the sort specificationmaxItemCount
- the maximum number of items to selectIfsException
- if the operation fails.protected Vector selectObjects(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String whereClause, SortSpecification sort, int maxItemCount, int rowNumber, String language, AttributeValue[] bindValues) throws IfsException
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetswhereClause
- select where clausesort
- the sort specificationmaxItemCount
- the maximum number of items to selectrowNumber
- the starting row number for the returned resultslanguage
- the language to use for full text search (if any)bindValues
- the bind valuesIfsException
- if the operation fails.protected Vector selectObjects(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String whereClause, SortSpecification sort, int maxItemCount, int rowNumber, String language, String hint, AttributeValue[] bindValues) throws IfsException
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetswhereClause
- select where clausesort
- the sort specificationmaxItemCount
- the maximum number of items to selectrowNumber
- the starting row number for the returned resultslanguage
- the language to use for full text search (if any)hint
- the SQL hint to use for the main select (if any)bindValues
- the bind valuesIfsException
- if the operation fails.protected Vector selectObjects(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String joinCondition, String whereClause, SortSpecification sort, int maxItemCount, int rowNumber, String language, String hint, AttributeValue[] bindValues) throws IfsException
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetsjoinCondition
- the join conditionwhereClause
- select where clausesort
- the sort specificationmaxItemCount
- the maximum number of items to selectrowNumber
- the starting row number for the returned resultslanguage
- the language to use for full text search (if any)hint
- the SQL hint to use for the main select (if any)bindValues
- the bind valuesIfsException
- if the operation fails.protected Vector selectObjects(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String[] bypassSecAliases, String joinCondition, String whereClause, SortSpecification sort, int maxItemCount, int rowNumber, String language, String hint, AttributeValue[] bindValues) throws IfsException
This is the complete variant.
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetsbypassSecAliases
- the aliases that indicates bypassing security for POsjoinCondition
- the join conditionwhereClause
- select where clausesort
- the sort specificationmaxItemCount
- the maximum number of items to selectrowNumber
- the starting row number for the returned resultslanguage
- the language to use for full text search (if any)hint
- the SQL hint to use for the main select (if any)bindValues
- the bind valuesIfsException
- if the operation fails.protected AttributeValueTable[] selectResults(String key, AttributeValue searchTarget, AttributeValue[] auxTargets, ColumnDescriptor[] colDescs, String[] bypassSecAliases, String joinCondition, String whereClause, SortSpecification sort, int maxItemCount, int rowNumber, String language, String hint, AttributeValue[] bindValues) throws IfsException
key
- key to use for caching the statementsearchTarget
- the primary search targetauxTargets
- the auxiliary search targetscolDescs
- the column descriptorsbypassSecAliases
- the aliases that indicates bypassing security for POsjoinCondition
- the join conditionwhereClause
- select where clausesort
- the sort specificationmaxItemCount
- the maximum number of items to selectrowNumber
- the starting row number for the returned resultslanguage
- the language to use for full text search (if any)hint
- the SQL hint to use for the main select (if any)bindValues
- the bind valuesIfsException
- if the operation fails.protected S_LibraryObjectCursor selectObjectsCursor(String whereClause, SortSpecification sort) throws IfsException
whereClause
- search where clausesort
- the sort specificationIfsException
- if the operation fails.protected long selectCount(String whereClause) throws IfsException
whereClause
- search where clauseIfsException
- if the operation fails.protected long selectCount(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String whereClause, String hint, AttributeValue[] bindValues) throws IfsException
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetswhereClause
- select where clausehint
- the SQL hint for the main selectbindValues
- the bind valuesIfsException
- if the operation fails.protected long selectCount(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String joinCondition, String whereClause, String hint, AttributeValue[] bindValues) throws IfsException
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetsjoinCondition
- the join conditionwhereClause
- select where clausehint
- the SQL hint for the main selectbindValues
- the bind valuesIfsException
- if the operation fails.protected long selectCount(String key, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String[] bypassSecAliases, String joinCondition, String whereClause, String hint, AttributeValue[] bindValues) throws IfsException
This is the complete variant.
key
- key to use for caching the statementdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetsbypassSecAliases
- the aliases that indicates bypassing security for POsjoinCondition
- the join conditionwhereClause
- select where clausehint
- the SQL hint for the main selectbindValues
- the bind valuesIfsException
- if the operation fails.protected LibraryQueryStatement getSimpleQueryStatement(String key, LibraryConnection lconn, String whereClause, SortSpecification sort, int maxCopies) throws IfsException
key
- statement keylconn
- connection contextwhereClause
- search where clausesort
- sort specificationmaxCopies
- max number of statement copies to keepIfsException
- if the operation fails.protected LibraryQueryStatement getComplexQueryStatement(String key, LibraryConnection lconn, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String whereClause, SortSpecification sort, String hint, int maxCopies, boolean countOnly) throws IfsException
Delegates to the complete variant with a null join condition.
key
- statement keylconn
- connection contextdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetswhereClause
- search where clausesort
- sort specificationhint
- SQLhint to use for the main selectmaxCopies
- max number of statement copies to keepcountOnly
- whether this is a "select count(*)" queryIfsException
- if the operation fails.protected LibraryQueryStatement getComplexQueryStatement(String key, LibraryConnection lconn, boolean distinct, AttributeValue searchTarget, AttributeValue[] auxTargets, String[] bypassSecAliases, String joinCondition, String whereClause, SortSpecification sort, String hint, int maxCopies, boolean countOnly, int maxItemCount) throws IfsException
This is the complete variant.
key
- statement keylconn
- connection contextdistinct
- whether to include "distinct" clausesearchTarget
- the primary search targetauxTargets
- the auxiliary search targetsbypassSecAliases
- the aliases that indicates bypassing security for POsjoinCondition
- the join conditionwhereClause
- search where clausesort
- sort specificationhint
- SQLhint to use for the main selectmaxCopies
- max number of statement copies to keepcountOnly
- whether this is a "select count(*)" querymaxItemCount
- max number of items to selectIfsException
- if the operation fails.protected LibraryQueryStatement getSearchResultQueryStatement(String key, LibraryConnection lconn, AttributeValue searchTarget, AttributeValue[] auxTargets, ColumnDescriptor[] colDescs, String[] bypassSecAliases, String joinCondition, String whereClause, SortSpecification sort, String hint, int maxCopies, int maxItemCount) throws IfsException
key
- statement keylconn
- connection contextsearchTarget
- the primary search targetauxTargets
- the auxiliary search targetscolDescs
- the column descriptorsbypassSecAliases
- the aliases that indicates bypassing security for POsjoinCondition
- the join conditionwhereClause
- search where clausesort
- sort specificationhint
- SQLhint to use for the main selectmaxCopies
- max number of statement copies to keepmaxItemCount
- max number of items to selectIfsException
- if the operation fails.protected LibraryQueryStatement getSimpleCountQueryStatement(String key, LibraryConnection lconn, String whereClause, int maxCopies) throws IfsException
key
- statement keylconn
- connection contextwhereClause
- search where clausemaxCopies
- max number of statement copies to keepIfsException
- if the operation fails.protected S_LibraryObjectData selectObjectById(Long id) throws IfsException
id
- object ID.IfsException
- if the operation fails.protected S_LibraryObjectData findObjectById(Long id) throws IfsException
id
- object ID.IfsException
- if the operation fails.public Vector selectObjectsByMasterId(Long masterId, String masterAttrName, SortSpecification sort) throws IfsException
masterId
- the master IDmasterAttrName
- the attribute name for the master ID referencesort
- the sort specificationIfsException
- if the operation fails.protected Vector selectArrayReferencingObjects(AttributeValue referencedValue, Long attributeId, SortSpecification sort) throws IfsException
Only works for object-type array attributes.
referencedValue
- the value being searched forattributeId
- the array attributesort
- the sort specificationIfsException
- if the operation fails.protected long selectArrayReferencingObjectsCount(AttributeValue referencedValue, Long attributeId) throws IfsException
Only works for object-type array attributes.
referencedValue
- the value being searched forattributeId
- the array attributeIfsException
- if the operation fails.protected Vector selectObjectsByStringAttribute(String attrValue, String masterAttrName, SortSpecification sort) throws IfsException
attrValue
- the value being searched formasterAttrName
- the string attributesort
- the sort specificationIfsException
- if the operation fails.protected long selectObjectsCountByMasterId(Long masterId, String masterAttrName) throws IfsException
masterId
- the master ID valuemasterAttrName
- the master attribute nameIfsException
- if the operation fails.protected boolean selectObjectsExistByMasterId(Long masterId, String masterAttrName) throws IfsException
masterId
- the master ID valuemasterAttrName
- the master attribute nameIfsException
- if the operation fails.protected S_LibraryObjectCursor selectObjectsCursorByMasterId(Long masterId, String masterAttrName, SortSpecification sort) throws IfsException
masterId
- the master ID valuemasterAttrName
- the master attribute namesort
- the sort specificationIfsException
- if the operation fails.protected S_LibraryObjectCursor selectArrayReferencingObjectsCursor(AttributeValue referencedValue, Long attributeId, SortSpecification sort) throws IfsException
Only works for object-type array attributes.
referencedValue
- the value being searched forattributeId
- the array attributesort
- the sort specificationIfsException
- if the operation fails.protected S_LibraryObjectCursor selectObjectsCursorByStringAttribute(String attrValue, String masterAttrName, SortSpecification sort) throws IfsException
attrValue
- the string attribute valuemasterAttrName
- the master attribute namesort
- the sort specificationIfsException
- if the operation fails.protected S_LibraryObjectData nextItem(S_LibraryObjectCursor cursor) throws IfsException
cursor
- the cursorIfsException
- if the operation fails.protected long getCountFromResultSet(ResultSet rset) throws IfsException
rset
- the ResultSetIfsException
- if the operation fails.protected void closeCursor(S_LibraryObjectCursor cursor)
cursor
- the cursor to close.protected String getStatementSuffix() throws IfsException
IfsException
- if the operation fails.protected final String generateStatementName(String classname, String stmtSuffix) throws IfsException
classname
- the class namestmtSuffix
- the statement suffixIfsException
- if the operation fails.protected final String generateStatementName(String classname, String relname, String stmtSuffix) throws IfsException
classname
- the class namerelname
- the relation name; null if not applicablestmtSuffix
- the statement suffixIfsException
- if the operation fails.protected final String generateStatementName(String classname, SortSpecification sort, String stmtSuffix) throws IfsException
classname
- the class namesort
- the sort specification; can be nullstmtSuffix
- the statement suffixIfsException
- if the operation fails.protected final String generateStatementName(String classname, String relname, SortSpecification sort, String stmtSuffix) throws IfsException
classname
- the class namerelname
- the relation name; null if not applicablesort
- the sort specification; can be nullstmtSuffix
- the statement suffixIfsException
- if the operation fails.Copyright © 2023. All rights reserved.