public final class LibraryQueryStatement extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INHERENT_PARAMS_PER_PUBLIC_CLASS
The maximum inherent parameters used per PublicObject class.
|
Constructor and Description |
---|
LibraryQueryStatement(String key,
LibraryConnection lconn,
SearchTarget[] targets,
ColumnDescriptor[] colDescs,
String joinCondition,
String whereClause,
SortSpecification sort,
String hint,
int maxCopies,
int maxItemCount)
Constructs a LibraryQueryStatement.
|
LibraryQueryStatement(String key,
LibraryConnection lconn,
SearchTarget[] targets,
String whereClause,
SortSpecification sort,
boolean countOnly,
boolean distinct,
int maxCopies)
Constructs a LibraryQueryStatement.
|
LibraryQueryStatement(String key,
LibraryConnection lconn,
SearchTarget[] targets,
String whereClause,
SortSpecification sort,
String hint,
boolean countOnly,
boolean distinct,
int maxCopies)
Constructs a LibraryQueryStatement.
|
LibraryQueryStatement(String key,
LibraryConnection lconn,
SearchTarget[] targets,
String joinCondition,
String whereClause,
SortSpecification sort,
String hint,
boolean countOnly,
boolean distinct,
int maxCopies,
int maxItemCount)
Constructs a LibraryQueryStatement.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close and clear the Prepared statement.
|
static String |
concatWhereClause(String str1,
String str2)
Concatenates two where clauses.
|
int |
getAccessCount()
Get the number of times the statement has been accessed
|
long |
getAccessSequence()
Gets the last access sequence; used by LibraryConnection
for purging.
|
protected S_ClassObjectData |
getClassData(S_LibrarySession session,
Long classId)
Gets the ClassData object for the specified class ID.
|
String |
getKey()
Gets the key by which this LibraryQueryStatement is stored in the
LibraryConnection.
|
LibraryConnection |
getLibraryConnection()
Gets the LibraryConnection for this LibraryQueryStatement.
|
int |
getMaxCopiesPerConnection()
Gets the maximum number of copies of this LibraryQueryStatement
that will be cached by each LibraryConnection.
|
int |
getParamOffset(S_LibrarySession sess)
Return the index of the first param that represents user-defined
parameters.
|
long |
getRsn()
Get the resolution sequence number of this instance, which reflects the
RSN of the LibraryConnection at the time this instance was constructed.
|
PreparedStatement |
getStatement(S_LibrarySession sess)
Return the Prepared statement.
|
int |
incrementAccessCount()
Increment the number of times the statement has been accessed.
|
static boolean |
obtainRowLockByIdWithNowait(S_LibrarySession session,
String tablename,
String columnname,
Long id)
Issues a SQL statement that will lock a row in table.
|
void |
setAccessSequence(long seq)
Sets the last access sequence; used by LibraryConnection
for purging.
|
int |
setInherentParameters(S_LibrarySession sess)
Sets the parameters that are not user-defined.
|
int |
setInherentParameters(S_LibrarySession sess,
int initialOffset)
Sets the parameters that are not user-defined.
|
public static final int INHERENT_PARAMS_PER_PUBLIC_CLASS
Currently has the value of 2.
public LibraryQueryStatement(String key, LibraryConnection lconn, SearchTarget[] targets, String whereClause, SortSpecification sort, boolean countOnly, boolean distinct, int maxCopies) throws IfsException
key
- statement keylconn
- the connection contexttargets
- the search targets; must be at least onewhereClause
- the search conditionsort
- the sort conditioncountOnly
- whether to select the count onlydistinct
- whether to include a distinct clausemaxCopies
- max copies of the statement per connectionIfsException
- if the operation failspublic LibraryQueryStatement(String key, LibraryConnection lconn, SearchTarget[] targets, String whereClause, SortSpecification sort, String hint, boolean countOnly, boolean distinct, int maxCopies) throws IfsException
key
- statement keylconn
- the connection contexttargets
- the search targets; must be at least onewhereClause
- the search conditionsort
- the sort conditionhint
- the SQL hint for the main selectcountOnly
- whether to select the count onlydistinct
- whether to include a distinct clausemaxCopies
- max copies of the statement per connectionIfsException
- if the operation failspublic LibraryQueryStatement(String key, LibraryConnection lconn, SearchTarget[] targets, String joinCondition, String whereClause, SortSpecification sort, String hint, boolean countOnly, boolean distinct, int maxCopies, int maxItemCount) throws IfsException
This is the main variant.
key
- statement keylconn
- the connection contexttargets
- the search targets; must be at least onejoinCondition
- the join conditionwhereClause
- the search conditionsort
- the sort conditionhint
- the SQL hint for the main selectcountOnly
- whether to select the count onlydistinct
- whether to include a distinct clausemaxCopies
- max copies of the statement per connectionmaxItemCount
- max number of items to selectIfsException
- if the operation failspublic LibraryQueryStatement(String key, LibraryConnection lconn, SearchTarget[] targets, ColumnDescriptor[] colDescs, String joinCondition, String whereClause, SortSpecification sort, String hint, int maxCopies, int maxItemCount) throws IfsException
This is the variant used for getSearchResults().
lconn
- the connection contexttargets
- the search targets; must be at least onecolDescs
- the column descriptorsjoinCondition
- the join conditionwhereClause
- the search conditionsort
- the sort conditionhint
- the SQL hint for the main selectmaxCopies
- max copies of the statement per connectionmaxItemCount
- max number of items to selectIfsException
- if the operation failspublic final void setAccessSequence(long seq)
seq
- the Access Sequencepublic final long getAccessSequence()
public final String getKey()
public final LibraryConnection getLibraryConnection()
public long getRsn()
public final int getMaxCopiesPerConnection()
public int getAccessCount()
public int incrementAccessCount()
public PreparedStatement getStatement(S_LibrarySession sess) throws IfsException
sess
- the session contextIfsException
- if the operation failspublic void close()
protected S_ClassObjectData getClassData(S_LibrarySession session, Long classId) throws IfsException
session
- the session contextclassId
- the class IDIfsException
- if operation fails.public int getParamOffset(S_LibrarySession sess) throws IfsException
This is directly related to the number of PublicObject classes in the classes list.
sess
- the session contextIfsException
- if the operation failspublic int setInherentParameters(S_LibrarySession sess) throws IfsException
Sets any parameters in the query that pertain to PublicObject security clauses.
sess
- the session contextIfsException
- if the operation failspublic int setInherentParameters(S_LibrarySession sess, int initialOffset) throws IfsException
Sets any parameters in the query that pertain to PublicObject security clauses.
sess
- the session contextinitialOffset
- the initial bind position offsetIfsException
- if the operation failspublic static String concatWhereClause(String str1, String str2)
str1
- the first clausestr2
- the second clausepublic static boolean obtainRowLockByIdWithNowait(S_LibrarySession session, String tablename, String columnname, Long id) throws IfsException
session
- the requesting sessiontablename
- the database table namecolumnname
- the ID column in the specified tableid
- the ID valueIfsException
- 20011: if unable to obtain the lockCopyright © 2023. All rights reserved.