Class Row

java.lang.Object
io.github.coho04.mysql.entities.Row
All Implemented Interfaces:
QueryHelper

public class Row extends Object implements QueryHelper
Represents a row in a MySQL database table.
  • Constructor Details

    • Row

      public Row(Table table, Column column, MYSQL mysql, String item)
      Represents a row in a database table.

      The Row class contains methods to retrieve and modify data in the corresponding row of the table.

      Parameters:
      table - The Table object representing the table the row belongs to.
      column - The Column object representing the column in the row.
      mysql - The MYSQL object representing the connection to the database.
      item - The value of the column in the row.
  • Method Details

    • getData

      public HashMap<String,SearchResult> getData()
      Retrieves data from the MySQL database.
      Returns:
      A HashMap containing the retrieved data. The keys of the HashMap are the column names, and the values are SearchResult objects representing the data in the corresponding columns.
    • setExportMap

      public void setExportMap(HashMap<String,SearchResult> newMap)
      Sets the export map for the Row.
      Parameters:
      newMap - The HashMap containing the new export map.
    • set

      public void set(Column column, Object item)
      Sets the value of a specific item in the column.
      Parameters:
      column - The Column object representing the column to set the value for.
      item - The new value to set for the column.
    • showColumns

      public List<Column> showColumns()
      Retrieves the list of columns in the table.
      Returns:
      The list of Column objects representing the columns in the table.
    • getColumns

      public List<Column> getColumns()
      Retrieves the list of columns in the table.
      Returns:
      The list of Column objects representing the columns in the table.
    • getDatabase

      public Database getDatabase()
      Retrieves the database associated with this Row.
      Returns:
      the database associated with this Row
    • getTable

      public Table getTable()
      Retrieves the table associated with this Row.
      Returns:
      the table associated with this Row
    • getId

      public int getId()
      Retrieves the id associated with this Row.
      Returns:
      the id associated with this Row
    • drop

      public void drop()
      Deletes the row from the database table associated with this object. The deletion is performed based on the value of the column in the row. The SQL query executed is as follows: DELETE FROM `tableName` WHERE `columnName` = 'columnValue';
      See Also: