|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.comp.AbstractTemplateModel
org.barracudamvc.core.comp.AbstractIterativeTemplateModel
org.barracudamvc.contrib.sam.models.IterativeResultSetModel
public class IterativeResultSetModel
A specific ListModel implementation for java.sql.ResultSets.
To use this class, simply pass a ResultSet to the constructor,
the model iterates over all rows of the underlying SQL query.
A sample HTML fragment might look like
Username
Password
abc
abc
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
logger
|
protected String |
name
name of the model |
protected ResultSet |
resultSet
ResultSet representing the SQL query |
Fields inherited from class org.barracudamvc.core.comp.AbstractTemplateModel |
---|
listeners, UNDEFINED, viewContext |
Constructor Summary | |
---|---|
IterativeResultSetModel(String name,
ResultSet rs)
initialize the model |
Method Summary | |
---|---|
Object |
getItem(String key)
get the model's value for a specific key |
String |
getName()
get the name of the model |
boolean |
hasNext()
returns resultSet.next() |
void |
loadNext()
empty implementation, does nothing. |
void |
setName(String name)
set the name of the model |
Methods inherited from class org.barracudamvc.core.comp.AbstractIterativeTemplateModel |
---|
postIterate, preIterate |
Methods inherited from class org.barracudamvc.core.comp.AbstractTemplateModel |
---|
addModelListener, fireModelChanged, getItem, getViewContext, processDirective, removeModelListener, setViewContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger logger
protected ResultSet resultSet
protected String name
Constructor Detail |
---|
public IterativeResultSetModel(String name, ResultSet rs)
name
- Name of the modelrs
- ResultSet to iterateMethod Detail |
---|
public String getName()
public void setName(String name)
name
- name of the modelpublic boolean hasNext()
hasNext
in interface IterativeModel
hasNext
in class AbstractIterativeTemplateModel
public Object getItem(String key)
getItem
in class AbstractTemplateModel
key
- must match the columns of the SQL query
public void loadNext()
loadNext
in interface IterativeModel
loadNext
in class AbstractIterativeTemplateModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |