org.less4j
Interface SQL.ORM
- Enclosing class:
- SQL
public static interface SQL.ORM
The simplest ORM interface possible for JDBC ResultSet.
Synopsis
protected static class _Collection implements ORM {
public Object jdbc2 (ResultSet rs) throws SQLException {
JSON.Array collection = null;
if (rs.next()) {
collection = new JSON.Array();
do {collection.add(rs.getObject(1));} while (rs.next());
}
rs.close();
return collection;
}
}
public static ORM collection = new _Collection ();
- Version:
- 0.30
- Author:
- Laurent Szyster
|
Method Summary |
java.lang.Object |
jdbc2(java.sql.ResultSet rs)
Try to map a ResultSet into a Java Object. |
jdbc2
java.lang.Object jdbc2(java.sql.ResultSet rs)
throws java.sql.SQLException
- Try to map a
ResultSet into a Java Object.
Note that the six implementations provided return either a
JSON.Array or a JSON.Object.
- Parameters:
rs - a JDBC ResultSet
- Returns:
- an
Object
- Throws:
java.sql.SQLException