java.lang.Object
studio.magemonkey.codex.mccore.sql.direct.SQLEntry

public class SQLEntry extends Object

Represents and individual entry in a MySQL table

  • Constructor Details

    • SQLEntry

      public SQLEntry(SQLDatabase database, SQLTable table, String name)

      Initializes a new SQL entry

      Parameters:
      database - database containing the entry
      table - table containing the entry
      name - name of the entry
  • Method Details

    • getData

      public <T extends ISQLEntryData> T getData(T container)

      Loads a set of data for an entry.

      This will instead return null if there was an error along the way.

      Parameters:
      container - container for the entry data
      Returns:
      loaded container for the entry data
    • getString

      public String getString(String key)

      Gets a string from the entry data.

      this returns null if an error occurred or there is no data set for the entry's value

      Parameters:
      key - value key
      Returns:
      string value
    • getInt

      public int getInt(String key)

      Gets a int from the entry data.

      this returns -1 if an error occurred or there is no data set for the entry's value

      Parameters:
      key - value key
      Returns:
      int value
    • getFloat

      public float getFloat(String key)

      Gets a float from the entry data.

      this returns -1 if an error occurred or there is no data set for the entry's value

      Parameters:
      key - value key
      Returns:
      float value
    • getDouble

      public double getDouble(String key)

      Gets a double from the entry data.

      this returns -1 if an error occurred or there is no data set for the entry's value

      Parameters:
      key - value key
      Returns:
      double value
    • getDate

      public Date getDate(String key)

      Gets a date from the entry data.

      this returns null if an error occurred or there is no data set for the entry's value

      Parameters:
      key - value key
      Returns:
      date value
    • set

      public void set(String key, String value)

      Sets a value for the entry.

      Parameters:
      key - key for the value
      value - value to set
    • set

      public void set(String key, int value)

      Sets a value for the entry.

      Parameters:
      key - key for the value
      value - value to set
    • set

      public void set(String key, double value)

      Sets a value for the entry.

      Parameters:
      key - key for the value
      value - value to set
    • set

      public void set(String key, float value)

      Sets a value for the entry.

      Parameters:
      key - key for the value
      value - value to set
    • set

      public void set(String key, Date value)

      Sets a value for the entry.

      Parameters:
      key - key for the value
      value - value to set
    • set

      public void set(HashMap<String,Object> data)

      Sets a collection of data to the entry.

      Parameters:
      data - data to set in the format (ColumnName, Value)
    • getName

      public String getName()

      Retrieves the name of the entry.

      Returns:
      entry name