How can I create a constants table in mysql that will match a type (using an int to differentiate among different types) with the full name of the type. The constants table should be read only and is not expected to ever need changing or updating only reading.
CREATE TABLE Accounts (
AccountType INT,
...
);
CREATE TABLE AccountTypes (
TypeId INT,
TypeName VARCHAR(255),
);
In Java there is ImmutableMap<Integer><String>
(in Guava), or Enums with integer instance variables, and in C++ there is also enum or static const string[...] ... = { ... }
where the type integer is the index.
Is this possible, or is there a better alternative?