|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gusdb.wdk.model.Answer
public class Answer
A list of RecordInstances representing one page of the answer to a Question.
The constructor of the Answer provides a handle (QueryInstance) on
the ResultList that is the list of primary keys for the all the records (not * just one page) that are the answer to the Question. The ResultList also
has a column that contains the row number (RESULT_TABLE_I) so that a list of
primary keys for a single page can be efficiently accessed.
The Answer is lazy in that it only constructs the set of RecordInstances
for the page when the first RecordInstance is requested.
The initial request triggers the creation of skeletal RecordInstances for
the page. They contain only primary keys (these being acquired from the
ResultList).
These skeletal RecordInstances are also lazy in that they only run an
attributes query when an attribute provided by that query is requested.
When they do run an attribute query, its QueryInstance is put into joinMode.
This means that the attribute query joins with the table containing
the primary keys, and, in one database query, generates rows containing
the attribute values for all the RecordInstances in the page.
The method
integrateAttributesQueryResult> is invoked by the
first RecordInstance in the page upon the first request for an attribute
provided by an attributes query. The query is a join with the list of
primary keys, and so has a row for each RecordInstance in the page, and
columns that provide the attribute values (plus RESULT_TABLE_I). The
values in the rows are integrated into the corresponding RecordInstance
(now no longer skeletal). integrateAttributesQueryResult> may
be called a number of times, depending upon how many attribute queries
the record class contains.
Attribute queries are guaranteed to provide one row for each RecordInstance
in the page. An exception is thrown otherwise.
Method Summary
QueryInstancegetAttributesQueryInstance()
java.util.MapgetDisplayParams()
QueryInstancegetIdsQueryInstance()
booleangetIsBoolean()
RecordInstancegetNextRecordInstance()
intgetPageSize()
java.util.MapgetParams()
QuestiongetQuestion()
provide property that user's term for question
intgetResultSize()
booleanhasMoreRecordInstances()
booleanisSummaryAttribute(java.lang.String attName)
java.lang.StringprintAsRecords()
java.lang.StringprintAsSummary()
print summary attributes, one per line
Note: not sure why this is needed
java.lang.StringprintAsTable()
print summary attributes in tab delimited table with header of attr.
voidresetRecordInstanceCounter()
voidresetRecordInstanceCurser()
java.lang.StringtoString()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Method Detail
getQuestion
public Question getQuestion()
getPageSize
public int getPageSize()
getResultSize
public int getResultSize()
throws WdkModelException
WdkModelException
getParams
public java.util.Map getParams()
getDisplayParams
public java.util.Map getDisplayParams()
getIsBoolean
public boolean getIsBoolean()
getAttributesQueryInstance
public QueryInstance getAttributesQueryInstance()
getIdsQueryInstance
public QueryInstance getIdsQueryInstance()
isSummaryAttribute
public boolean isSummaryAttribute(java.lang.String attName)
getNextRecordInstance
public RecordInstance getNextRecordInstance()
throws WdkModelException
WdkModelException
hasMoreRecordInstances
public boolean hasMoreRecordInstances()
throws WdkModelException
WdkModelException
resetRecordInstanceCurser
public void resetRecordInstanceCurser()
printAsRecords
public java.lang.String printAsRecords()
throws WdkModelException,
WdkUserException
WdkModelException
WdkUserException
printAsSummary
public java.lang.String printAsSummary()
throws WdkModelException,
WdkUserException
WdkModelException
WdkUserException
printAsTable
public java.lang.String printAsTable()
throws WdkModelException,
WdkUserException
WdkModelException
WdkUserException
resetRecordInstanceCounter
public void resetRecordInstanceCounter()
toString
public java.lang.String toString()
toString in class java.lang.Object
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD