|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.evanmclean.evlib.velocity.AbstractResultSetMethodizer
public abstract class AbstractResultSetMethodizer
A wrapper class around a JDBC ResultSet that allows access to the columns as
properties. See ResultSetMethodizer
for more information.
Nested Class Summary | |
---|---|
class |
AbstractResultSetMethodizer.Row
Each row from the result set is returned as one of these objects which does the translation from property name to a column in the result set. |
Constructor Summary | |
---|---|
protected |
AbstractResultSetMethodizer(ResultSet rs)
|
protected |
AbstractResultSetMethodizer(ResultSetMetaData meta)
|
Method Summary | |
---|---|
protected Collection<String> |
getPropertyNames(String column_name)
A way of translating column names to potential property names. |
void |
remove()
Throws UnsupportedOperationException as this functionality is not supported. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Iterator |
---|
hasNext, next |
Constructor Detail |
---|
protected AbstractResultSetMethodizer(ResultSet rs) throws SQLException
SQLException
protected AbstractResultSetMethodizer(ResultSetMetaData meta) throws SQLException
SQLException
Method Detail |
---|
public void remove()
remove
in interface Iterator<AbstractResultSetMethodizer.Row>
UnsupportedOperationException
protected Collection<String> getPropertyNames(String column_name)
A way of translating column names to potential property names. If two or more columns translate to the same property name then a VelocityException will be thrown from the constructor.
Note that the column name itself is always adding as a mapping, so you do not need to include it in the returned collection. Also, all property names are case-insensitive.
The default behaviour is to include a version of the column name with all underscore characters removed. So if your result set is based on an SQL statement such as:
SELECT user_id FROM users
Then in your velocity template you could use any of the following names to match it:
user_id
userid
UserId
column_name
- The name of the column to provide mapping translations for.
null
if you only want the column name itself used as a
property name, or a collection of other potential column names.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |