public class LibraryObjectLookupCache extends Object
Constructor and Description |
---|
LibraryObjectLookupCache(String className,
String nameAttribute,
String nameColumn,
boolean caseSensitive,
boolean selectbyUpper,
int maxCachedItems)
Construct a LibraryObjectLookupCache.
|
LibraryObjectLookupCache(String className,
String nameAttribute,
String nameColumn,
String key,
boolean caseSensitive,
boolean selectbyUpper,
int maxCachedItems,
String extraQual,
String orderBy)
Construct a LibraryObjectLookupCache.
|
Modifier and Type | Method and Description |
---|---|
LibraryObjectInterface[] |
findAll(LibrarySessionInterface session)
Finds all qualifying objects.
|
LibraryObjectInterface |
findByName(LibrarySessionInterface session,
String name)
Finds an object with the specified name.
|
protected String |
getExtraQualification(LibrarySessionInterface session)
Gets the extra search qualification to use, if any.
|
protected String |
getFindAllStatementKey(LibrarySessionInterface session)
Gets the key to use for caching the "find all" statement.
|
protected String |
getFindStatementKey(LibrarySessionInterface session)
Gets the key to use for caching the "find" statement.
|
static LibraryObjectLookupCache |
getInstance(LibrarySessionInterface session,
String key)
Gets a registered instance by key, using the service context associated
with the specified session.
|
void |
registerInstance(LibrarySessionInterface session,
String key)
Register an instance by key, using the service context associated
with the specified session.
|
protected LibraryObjectInterface |
validateObject(LibrarySessionInterface session,
String name,
LibraryObjectInterface obj)
Validate the specified object, making sure that it is still persistent
and matches the specified name.
|
public LibraryObjectLookupCache(String className, String nameAttribute, String nameColumn, boolean caseSensitive, boolean selectbyUpper, int maxCachedItems)
className
- the class name to be used for the lookupnameAttribute
- the name of the attribute being used as the lookupnameColumn
- the name of the column being used as the lookup;
a null indicates that the column is same as the
attribute namecaseSensitive
- whether the lookup should be case sensitiveselectbyUpper
- whether the selection requires a nls_upper
clause; only valid when caseSensitive is falsemaxCachedItems
- max number of items to cache; 0 indicates unlimitedpublic LibraryObjectLookupCache(String className, String nameAttribute, String nameColumn, String key, boolean caseSensitive, boolean selectbyUpper, int maxCachedItems, String extraQual, String orderBy)
className
- the class name to be used for the lookupnameAttribute
- the name of the attribute being used as the lookupnameColumn
- the name of the column being used as the lookup;
a null indicates that the column is same as the
attribute namekey
- the key that uniquely identifies this type of
LibraryObjectLookupCache; if null, derive from
other settingscaseSensitive
- whether the lookup should be case sensitiveselectbyUpper
- whether the selection requires a nls_upper
clause; only valid when caseSensitive is falsemaxCachedItems
- max number of items to cache; 0 indicates unlimitedextraQual
- extra search qualifcation used in both findAll()
and findByName(); null indicates no additional qualorderBy
- sort qualifcation used for findAll();
null means order by the specified name columnpublic void registerInstance(LibrarySessionInterface session, String key) throws IfsException
session
- the session contextkey
- the key used to register the instanceIfsException
- if the operation failspublic static LibraryObjectLookupCache getInstance(LibrarySessionInterface session, String key) throws IfsException
session
- the session contextkey
- the key used in registering the instanceIfsException
- if the operation failspublic LibraryObjectInterface findByName(LibrarySessionInterface session, String name) throws IfsException
session
- the session contextname
- the name of the desired objectIfsException
- if the operation failspublic LibraryObjectInterface[] findAll(LibrarySessionInterface session) throws IfsException
The array of objects returned is potentially filtered by the search qualification specifying during construction. The objects are sorted by the sort qualification specified at construction, or sorted by the name column by default.
session
- the session contextIfsException
- if the operation failsprotected String getExtraQualification(LibrarySessionInterface session) throws IfsException
Can be overridden by subclasses to provide dynamic qualification if needed.
session
- the session contextIfsException
- if the operation failsprotected String getFindStatementKey(LibrarySessionInterface session) throws IfsException
Can be overridden by subclasses to provide dynamic qualification if needed.
session
- the session contextIfsException
- if the operation failsprotected String getFindAllStatementKey(LibrarySessionInterface session) throws IfsException
Can be overridden by subclasses to provide dynamic qualification if needed.
session
- the session contextIfsException
- if the operation failsprotected LibraryObjectInterface validateObject(LibrarySessionInterface session, String name, LibraryObjectInterface obj) throws IfsException
Can be extended by subclasses to provide additional validation.
session
- the session contextname
- the name to check for a matchobj
- the object to validateIfsException
- if the operation failsCopyright © 2023. All rights reserved.