Added support for byte arrays and full table loads.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1921 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2006-09-21 00:31:21 +00:00
parent d68fdb8106
commit 121b864558
3 changed files with 48 additions and 19 deletions
@@ -197,16 +197,20 @@ public class DepotMarshaller<T>
/**
* Creates a query for instances of this persistent object type using the
* supplied key.
* supplied key. If null is supplied all instances will be loaded.
*/
public PreparedStatement createQuery (
Connection conn, DepotRepository.Key key)
throws SQLException
{
String query = "select " + _fullColumnList + " from " + getTableName() +
" where " + key.toWhereClause();
String query = "select " + _fullColumnList + " from " + getTableName();
if (key != null) {
query += " where " + key.toWhereClause();
}
PreparedStatement pstmt = conn.prepareStatement(query);
key.bindArguments(pstmt, 1);
if (key != null) {
key.bindArguments(pstmt, 1);
}
return pstmt;
}