+ public Row selectExactlyOne(Connection con, Column[] columns, Table[] tables, Condition[] conditions)
+ throws SQLException
+ {
+ Sort[] sorts = new Sort[0];
+ int limit = 2;
+ List<Row> rows = select(con, columns, tables, conditions, sorts, limit);
+ if (rows.size() < 1) {
+ throw new SQLException("Expected one result, but found none: ", selectSql(columns, tables, conditions, sorts, limit));
+ }
+ if (rows.size() > 1) {
+ throw new SQLException("Expected one result, but found more than one: " + selectSql(columns, tables, conditions, sorts, limit));
+ }
+
+ return rows.get(0);
+ }
+