|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.paneris.jal.model.RecordSet
public class RecordSet
A RecordSet provides functionality that allows you to navigate a set of results.
It does this by storing itself in the session so that it can be navigated
For this reason, the constructors are private, and you will be expected to always get the RecordsSet using getInstance();
If you want to force the creation of a new record set, ensure that the context contains a "submit" form value. (inplying that a new search has been run.)
usage example: RecordSet set = RecordSet.getInstance(context, db, table, sqlString, null); context.put("navigation", set); for (Enumeration enum = set.getNext(); enum.hasMoreElements();) { Integer id = (Integer) enum.nextElement(); body.addElement(new DDRecord(db,table,id)); }
Field Summary | |
---|---|
java.lang.String |
database
|
DataCache |
dataCache
|
protected static boolean |
debug
|
int |
increment
|
java.lang.String |
sqlString
|
Constructor Summary | |
---|---|
RecordSet(java.lang.String db,
java.lang.String table,
java.sql.PreparedStatement sqlStatement,
java.lang.Integer inc)
Private Constructor to build a RecordSet given a prepared statement nb this method does not set a max limit of the records returned. |
|
RecordSet(java.lang.String db,
java.lang.String table,
java.lang.String sql,
java.lang.Integer inc)
Private Constructor to build a RecordSet given an sql string. |
|
RecordSet(java.lang.String db,
java.lang.String table,
UniqueVector results,
java.lang.Integer inc)
Constructor to build a RecordSet given a vector of id's of results. |
Method Summary | |
---|---|
void |
addElement(java.lang.Integer id)
|
void |
buildSet(java.lang.String db,
java.lang.String table,
java.sql.PreparedStatement sqlStatement,
java.lang.Integer inc)
|
void |
doNavigation(org.webmacro.servlet.WebContext context)
|
int |
getCurrentRecord()
|
int |
getDisplayCurrentRecord()
|
boolean |
getEnd()
|
int |
getIncrement()
|
static RecordSet |
getInstance(org.webmacro.servlet.WebContext context,
java.lang.String identifier)
Returns the single instance, or null it can't be found (or has changed) the RecordSet is referenced in the session by the identifier |
static RecordSet |
getInstance(org.webmacro.servlet.WebContext context,
java.lang.String db,
java.lang.String table,
java.sql.PreparedStatement sql,
java.lang.Integer inc,
java.lang.String identifier)
Returns the single instance, creating one if it can't be found (or has changed) set the increment to null, in order to have it defaulted for this table the RecordSet is referenced in the session by the identifier |
static RecordSet |
getInstance(org.webmacro.servlet.WebContext context,
java.lang.String db,
java.lang.String table,
java.lang.String sql,
java.lang.Integer inc)
copes with situations where no identifier is specified (should be marked as depreciated) |
static RecordSet |
getInstance(org.webmacro.servlet.WebContext context,
java.lang.String db,
java.lang.String table,
java.lang.String sql,
java.lang.Integer inc,
java.lang.String identifier)
Returns the single instance, creating one if it can't be found (or has changed) set the increment to null, in order to have it defaulted for this table the RecordSet is referenced in the session by the identifier |
static RecordSet |
getInstance(org.webmacro.servlet.WebContext context,
java.lang.String db,
java.lang.String table,
UniqueVector results,
java.lang.Integer inc)
Returns the single instance, creating one if it can't be found (or has changed) use this method if you have pre-built your results (ie a simple sql string does not provide enough flexability). |
boolean |
getLimited()
|
int |
getMaxRecord()
|
TableMetaData |
getMetaData()
|
java.util.Enumeration |
getNext()
|
int |
getPage()
|
int |
getPages()
|
DDRecord |
getRecord(java.lang.String database,
java.lang.String table,
java.lang.Integer id)
|
java.util.Vector |
getRows()
|
int |
getSize()
|
java.lang.String |
getSqlString()
|
boolean |
getStart()
|
java.util.Hashtable |
getState()
|
void |
loadData()
|
void |
moveNext()
|
void |
movePrevious()
|
boolean |
removeID(java.lang.Integer id)
|
void |
setCurrentRecord(int i)
|
void |
setIgnoreDeleted(boolean del)
set the ignore deleted flag |
void |
setMaxRecord(int a)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final boolean debug
public java.lang.String database
public java.lang.String sqlString
public int increment
public DataCache dataCache
Constructor Detail |
---|
public RecordSet(java.lang.String db, java.lang.String table, java.lang.String sql, java.lang.Integer inc) throws java.lang.Exception
java.lang.Exception
public RecordSet(java.lang.String db, java.lang.String table, UniqueVector results, java.lang.Integer inc) throws java.lang.Exception
java.lang.Exception
public RecordSet(java.lang.String db, java.lang.String table, java.sql.PreparedStatement sqlStatement, java.lang.Integer inc) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void buildSet(java.lang.String db, java.lang.String table, java.sql.PreparedStatement sqlStatement, java.lang.Integer inc) throws java.lang.Exception
java.lang.Exception
public static RecordSet getInstance(org.webmacro.servlet.WebContext context, java.lang.String db, java.lang.String table, UniqueVector results, java.lang.Integer inc) throws java.lang.Exception
java.lang.Exception
public static RecordSet getInstance(org.webmacro.servlet.WebContext context, java.lang.String db, java.lang.String table, java.lang.String sql, java.lang.Integer inc, java.lang.String identifier) throws java.lang.Exception
java.lang.Exception
public static RecordSet getInstance(org.webmacro.servlet.WebContext context, java.lang.String db, java.lang.String table, java.sql.PreparedStatement sql, java.lang.Integer inc, java.lang.String identifier) throws java.lang.Exception
java.lang.Exception
public static RecordSet getInstance(org.webmacro.servlet.WebContext context, java.lang.String db, java.lang.String table, java.lang.String sql, java.lang.Integer inc) throws java.lang.Exception
java.lang.Exception
public void setIgnoreDeleted(boolean del)
public static RecordSet getInstance(org.webmacro.servlet.WebContext context, java.lang.String identifier) throws java.lang.Exception
java.lang.Exception
public void doNavigation(org.webmacro.servlet.WebContext context) throws java.lang.Exception
java.lang.Exception
public java.util.Enumeration getNext() throws java.lang.Exception
java.lang.Exception
public java.util.Vector getRows() throws java.lang.Exception
java.lang.Exception
public void loadData() throws java.lang.Exception
java.lang.Exception
public DDRecord getRecord(java.lang.String database, java.lang.String table, java.lang.Integer id) throws java.lang.Exception
java.lang.Exception
public boolean removeID(java.lang.Integer id)
public void addElement(java.lang.Integer id)
public TableMetaData getMetaData()
public int getIncrement()
public boolean getLimited()
public int getSize()
public int getCurrentRecord()
public void setCurrentRecord(int i)
public int getDisplayCurrentRecord()
public int getMaxRecord()
public void setMaxRecord(int a)
public int getPages()
public int getPage()
public java.lang.String getSqlString()
public void moveNext()
public void movePrevious()
public boolean getStart()
public boolean getEnd()
public java.util.Hashtable getState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |