mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-10 07:21:20 +01:00
Add an isEmpty() to RowSet
This commit is contained in:
parent
023cabd849
commit
eb8b6eb393
@ -36,4 +36,13 @@ public class RowSet {
|
||||
public int size() {
|
||||
return rowList.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the RowSet is empty
|
||||
*
|
||||
* @return Is the RowSet empty?
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
}
|
@ -84,7 +84,7 @@ public class Table {
|
||||
*/
|
||||
public Row getRow(String criteria) throws SQLException {
|
||||
RowSet rs = select(criteria);
|
||||
return (rs.size() > 0 ? rs.get(0) : new Row());
|
||||
return (!rs.isEmpty() ? rs.get(0) : new Row());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user