@@ -22,13 +22,13 @@ public class Row implements QueryHelper {
2222
2323 /**
2424 * Represents a row in a database table.
25- *
25+ * <p>
2626 * The Row class contains methods to retrieve and modify data in the corresponding row of the table.
2727 *
28- * @param table The Table object representing the table the row belongs to.
28+ * @param table The Table object representing the table the row belongs to.
2929 * @param column The Column object representing the column in the row.
30- * @param mysql The MYSQL object representing the connection to the database.
31- * @param item The value of the column in the row.
30+ * @param mysql The MYSQL object representing the connection to the database.
31+ * @param item The value of the column in the row.
3232 */
3333 public Row (Table table , Column column , MYSQL mysql , String item ) {
3434 this .db = table .getDatabase ();
@@ -51,13 +51,11 @@ public HashMap<String, SearchResult> getData() {
5151 exportMap = executeQuery (query , rs -> {
5252 HashMap <String , SearchResult > map = new HashMap <>();
5353 ResultSetMetaData rsMetaData = rs .getMetaData ();
54- if (rs .next ()) {
55- for (int i = 1 ; i <= rsMetaData .getColumnCount (); i ++) {
56- if (rs .getString (rsMetaData .getColumnName (i )) != null ) {
57- map .put (rsMetaData .getColumnName (i ), new SearchResult (rs .getString (rsMetaData .getColumnName (i ))));
58- } else {
59- map .put (rsMetaData .getColumnName (i ), null );
60- }
54+ for (int i = 1 ; i <= rsMetaData .getColumnCount (); i ++) {
55+ if (rs .getString (rsMetaData .getColumnName (i )) != null ) {
56+ map .put (rsMetaData .getColumnName (i ), new SearchResult (rs .getString (rsMetaData .getColumnName (i ))));
57+ } else {
58+ map .put (rsMetaData .getColumnName (i ), null );
6159 }
6260 }
6361 return map ;
@@ -79,7 +77,7 @@ public void setExportMap(HashMap<String, SearchResult> newMap) {
7977 * Sets the value of a specific item in the column.
8078 *
8179 * @param column The Column object representing the column to set the value for.
82- * @param item The new value to set for the column.
80+ * @param item The new value to set for the column.
8381 */
8482 public void set (Column column , Object item ) {
8583 executeUpdate ("UPDATE `" + this .getTable ().getName () + "` SET `" + column .getName () + "` = '" + item .toString () + "' WHERE `" + this .column .getName () + "` = '" + this .item + "';" , mysql );
@@ -134,7 +132,7 @@ public int getId() {
134132 * Deletes the row from the database table associated with this object.
135133 * The deletion is performed based on the value of the column in the row.
136134 * The SQL query executed is as follows:
137- * DELETE FROM `tableName` WHERE `columnName` = 'columnValue';
135+ * DELETE FROM `tableName` WHERE `columnName` = 'columnValue';
138136 *
139137 * @see Row#getTable() to retrieve the table associated with this row
140138 * @see Row#column to retrieve the column associated with this row
0 commit comments