public class Category
extends TransactionHolderModel
Models a Category in the database
Modifier and Type | Class and Description |
---|---|
static class |
Category.Companion
Static Methods
|
Modifier and Type | Field and Description |
---|---|
static Category.Companion |
Companion
Static Methods
|
Constructor and Description |
---|
Category(int id,
java.lang.String name)
Models a Category in the database
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Checks for equality with another object
|
static Category |
fromResultSet(java.sql.ResultSet resultSet)
Generates a Category object from a ResultSet
|
static Category |
get(DbHandler dbHandler,
int id)
Retrieves a Category from the database by its ID
|
static Category |
get(DbHandler dbHandler,
java.lang.String nameOrId)
Retrieves a Category from the database by its name or ID
|
getTransactions
createHelper, getName, toString
public static Category.Companion Companion
Static Methods
public Category(int id, java.lang.String name)
Models a Category in the database
id
- : The ID of the category in the databasename
- : The name of the categoryid
- : The ID of the category in the databasename
- : The name of the categorypublic boolean equals(java.lang.Object other)
Checks for equality with another object
other
- : The other objectpublic static Category fromResultSet(java.sql.ResultSet resultSet)
Generates a Category object from a ResultSet
resultSet
- : The ResultSet to use to generate the Category objectpublic static Category get(DbHandler dbHandler, int id)
Retrieves a Category from the database by its ID
dbHandler
- : The database handler to useid
- : The ID of the categorypublic static Category get(DbHandler dbHandler, java.lang.String nameOrId)
Retrieves a Category from the database by its name or ID
dbHandler
- : The database handler to usenameOrId
- : The name or ID of the category