public class TdbRecordSet extends TdbMessageProvider implements com.tietoenator.trip.jxp.internal.utils.DOMSink
Constructor and Description |
---|
TdbRecordSet(TdbSession session)
Constructor, creates a blank instance
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the record set of any content retrieved by a get() operation
This version of the method does not reset the record set to its default state, simply removes any accumulated TdbRecord instances. |
void |
delete()
Delete the records covered by the record set from their database(s)
This method causes network I/O. |
void |
get()
Retrieve the record set defined by the various properties of the instance.
|
org.w3c.dom.Document |
get(TdbDataFormat fmt)
Retrieve the record set defined by the various properties of the instance.
|
int |
getAffectedRecords()
Retrieve the number of records affected by the most recent operation
This method will return the number of records (total) hit by the most recent search, or the number of records affected by the most recent insert, update or delete, depending on what the most recent activity was. |
java.lang.String |
getDatabase()
Retrieve the name of the database that provides the context for the record set
|
java.lang.String |
getDidYouMean()
Returns a "did-you-mean" suggestion for the query that produced the
last retrieved record set.
|
int |
getFrom()
Retrieve the lower bound of the record set's domain
|
int |
getId()
Retrieve the unique ID of the single record covered by this record set
|
int |
getMapMax()
Retrieve any maximum value established for performing mapped searches (retrieval only)
|
java.lang.String |
getName()
Retrieve the name of the single record covered by this record set
|
java.lang.String |
getQuery()
Retrieve any query string that has been established as a retrieval context
|
int |
getQueryHits()
Retrieve the number terms hit by the last query-driven retrieval
|
int |
getQueryRecords()
Retrieve the number of records (total) hit by the last query-driven retrieval
|
int |
getSearchSet()
Retrieve the ID of the search set with which the record will be associated
|
java.lang.String |
getSortKeys()
Retrieve the comma-separated list of sort keys
|
int |
getSortMax()
Retrieve any maximum value established for sorting with the record set (retrieval only)
|
boolean |
getSortRanked()
Check if the record set's retrieval operations are to be sorted by relevance rank
|
java.lang.String |
getThesaurus()
Retrieve the name of the thesaurus used with the query for the record set.
|
int |
getTo()
Retrieve the upper bound of the record set's domain
|
void |
insert(java.util.Collection<TdbRecord> records)
Insert new records to the database associated with this record set
Only the database (see setDatabase()) property is valid for this method. |
boolean |
isQueryCCL()
Check if the provided query statement is in CCL
|
boolean |
isQuerySQL()
Check if the provided query statement in is SQL
|
boolean |
isQueryXPath()
Check if the provided query statement in is XPath
|
TdbRecord |
recordAt(int offset)
Retrieve the TdbRecord at the defined offset within the set
If the provided offset is outside of the bounds of the record set, an INVALID_ARGS exception is thrown. |
java.util.List<TdbRecord> |
records()
Retrieve the collection of records retrieved most recently by the get() method
from the server
|
void |
reset()
Clear the record set and all associated parameters
All properties of the record set are reset by this method to their default state, rendering the record unusable until properties are reestablished |
void |
setDatabase(java.lang.String name)
Set the name of the database (or thesaurus, or cluster) that will provide
the context for the record set
|
void |
setFrom(int from)
Establish the lower bound of a ranged record set domain.
|
void |
setId(int id)
Establish the unique ID of the single record covered by this record set
|
void |
setMapMax(int max)
Establish the maximum number of records that will be mapped during a retrieval operation
|
void |
setName(java.lang.String name)
Establish the name of the record covered by this record set.
|
void |
setQuery(java.lang.String query)
Set a query statement that will be used to retrieve records
Setting a query as the domain of the record set works in conjunction with the setDatabase() setting, i.e. |
void |
setQueryCCL(boolean ccl)
Establish whether the query statement is in CCL
|
void |
setQuerySQL(boolean sql)
Establish whether the query statement is in SQL
|
void |
setQueryXPath(boolean xpath)
Establish whether the query statement is an XPath expression.
|
void |
setRetrievalTemplate(TdbRecord template)
Set the record set template, i.e.
|
void |
setRetrieveReversed(boolean rev)
Set whether to retrieve the result set in reverse.
|
void |
setSearchSet(int srch)
Establish the ID of the search set with which the record will be associated
|
void |
setSortKeys(java.lang.String keys)
Establish sort criteria for the record set (retrieval only)
|
void |
setSortMax(int max)
Establish the maximum number of records that will be sorted during a retrieval operation
|
void |
setSortRanked(boolean rank)
Establish whether the record set's retrieval operations are to be sorted by relevance rank
|
void |
setThesaurus(java.lang.String thes)
Set the name of a thesaurus to use in the query for the record set.
|
void |
setTo(int to)
Establish the upper bound of a ranged record set domain.
|
void |
update(TdbRecord values)
Apply the same update transformation to all records covered by the record set
This method causes network I/O. |
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
cancel, getSession, isCancelable, setCancelable
public TdbRecordSet(TdbSession session) throws TdbException
session
- Active sessionTdbException
public java.lang.String getQuery()
public void setQuery(java.lang.String query) throws TdbException
query
- The query statementTdbException
public boolean isQueryCCL()
public void setQueryCCL(boolean ccl)
ccl
- True if the provided query is in CCLpublic boolean isQuerySQL()
public boolean isQueryXPath()
public void setQuerySQL(boolean sql)
sql
- True if the provided query is in SQL, false otherwisepublic void setQueryXPath(boolean xpath)
xpath
- True if the provided query is in XPath, false otherwisepublic int getQueryRecords()
public int getAffectedRecords()
public int getQueryHits()
public java.lang.String getDidYouMean()
public java.lang.String getDatabase()
public void setDatabase(java.lang.String name)
name
- Name of database, thesaurus or clusterpublic java.lang.String getThesaurus()
public void setThesaurus(java.lang.String thes)
thes
- Name of thesauruspublic int getSearchSet()
public void setSearchSet(int srch)
srch
- Search set unique IDpublic int getFrom()
public void setFrom(int from)
from
- Lower boundpublic int getTo()
public void setTo(int to)
to
- Upper boundpublic int getId()
public void setId(int id)
id
- The record's unique IDpublic java.lang.String getName()
public void setName(java.lang.String name) throws TdbException
name
- Record nameTdbException
public java.lang.String getSortKeys()
public void setSortKeys(java.lang.String keys)
keys
- A comma-separated list of keyspublic boolean getSortRanked()
public void setSortRanked(boolean rank)
rank
- If true, records will be primarily sorted by relevance, with any other
sort keys being used as secondary sort criteriapublic void setRetrieveReversed(boolean rev)
rev
- If true, records will be returned from the search set in reverse.public int getSortMax()
public void setSortMax(int max)
max
- Sort maxpublic int getMapMax()
public void setMapMax(int max)
max
- Map maxpublic void setRetrievalTemplate(TdbRecord template)
template
- The retrieval templatepublic java.util.List<TdbRecord> records()
public void reset()
public void clear()
public TdbRecord recordAt(int offset) throws TdbException
offset
- The zero-based offset within the set of the record to retrieveTdbException
public void get() throws TdbException
TdbException
public org.w3c.dom.Document get(TdbDataFormat fmt) throws TdbException
This method does not deserialize into the record collection, which will be blank after invocation.
Values for any string fields requested are returned inline encoded as base64. This may result in a very large response document and may cause session timeout or lack of enough memory resources to complete processing. Make sure to set up the retrieval template to exclude any unnecessary STRING fields.
This method causes network I/O.
fmt
- The format of the XML to retrieveTdbException
public void delete() throws TdbException
TdbException
public void update(TdbRecord values) throws TdbException
values
- A valid record, containing field updates to be applied
to all records covered by the record set.TdbException
public void insert(java.util.Collection<TdbRecord> records) throws TdbException
records
- A collection of TdbRecord objects to be inserted to the named databaseTdbException