Permalink
Browse files

s/search/select/g

  • Loading branch information...
1 parent 35a0d27 commit 470004eea3ae306a08151ce5ba6671e222dfa67a @kazuho committed Jul 14, 2014
@@ -59,8 +59,8 @@ public Condition(TableDefinition<Row> tableDefinition, String term, AnyType... p
return this;
}
- public ArrayList<Row> search(Connection conn) throws SQLException {
- return tableDefinition.search(conn, this);
+ public ArrayList<Row> select(Connection conn) throws SQLException {
+ return tableDefinition.select(conn, this);
}
public void update(Connection conn, Row changes) throws SQLException {
@@ -21,7 +21,7 @@ protected TableDefinition(String tableName) {
public abstract AnyType[] getColumns(Row row);
- public ArrayList<Row> search(Connection conn, Condition<Row> cond) throws SQLException {
+ public ArrayList<Row> select(Connection conn, Condition<Row> cond) throws SQLException {
String sql = "SELECT " + _join(_getColumnNames(null)) + " FROM " + TABLE_NAME + _buildWhere(cond);
PreparedStatement ps = conn.prepareStatement(sql);
this._bindWhere(cond, ps, 1);
@@ -22,15 +22,15 @@ public static void main(String[] args) {
new Member().setName("kazuho").insert(conn);
// SELECT FROM member WHERE (name=?) OR (name=?)
- for (Member m : Member.name.is("yappo").or(Member.name.is("tokuhirom")).orderBy(Member.id.asc).search(conn)) {
+ for (Member m : Member.name.is("yappo").or(Member.name.is("tokuhirom")).orderBy(Member.id.asc).select(conn)) {
System.out.println(Long.toString(m.getId()) + ":" + m.getName());
}
// UPDATE member SET name=? WHERE name=?
Member.name.is("yappo").update(conn, new Member().setName("seiitaishogun"));
// SELECT FROM member WHERE id BETWEEN ? AND ?
- for (Member m: Member.id.between(1L, 1000L).limit(1).search(conn)) {
+ for (Member m: Member.id.between(1L, 1000L).limit(1).select(conn)) {
System.out.println(Long.toString(m.getId()) + ":" + m.getName());
}

0 comments on commit 470004e

Please sign in to comment.