Class SQLEntry
Represents and individual entry in a MySQL table
-
Constructor Summary
ConstructorsConstructorDescriptionSQLEntry(SQLDatabase database, SQLTable table, String name) Initializes a new SQL entry -
Method Summary
Modifier and TypeMethodDescription<T extends ISQLEntryData>
TgetData(T container) Loads a set of data for an entry.Gets a date from the entry data.doubleGets a double from the entry data.floatGets a float from the entry data.intGets a int from the entry data.getName()Retrieves the name of the entry.Gets a string from the entry data.voidSets a value for the entry.voidSets a value for the entry.voidSets a value for the entry.voidSets a value for the entry.voidSets a value for the entry.voidSets a collection of data to the entry.
-
Constructor Details
-
SQLEntry
Initializes a new SQL entry
- Parameters:
database- database containing the entrytable- table containing the entryname- name of the entry
-
-
Method Details
-
getData
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
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
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
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
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
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
Sets a value for the entry.
- Parameters:
key- key for the valuevalue- value to set
-
set
Sets a value for the entry.
- Parameters:
key- key for the valuevalue- value to set
-
set
Sets a value for the entry.
- Parameters:
key- key for the valuevalue- value to set
-
set
Sets a value for the entry.
- Parameters:
key- key for the valuevalue- value to set
-
set
Sets a value for the entry.
- Parameters:
key- key for the valuevalue- value to set
-
set
Sets a collection of data to the entry.
- Parameters:
data- data to set in the format (ColumnName, Value)
-
getName
Retrieves the name of the entry.
- Returns:
- entry name
-