0

So lets say I have a sql table called "names" that has the following columns: NAME, X, X, X Lets say I now make a enum class:

public enum Names {
   //I want all the `Name` values in the `Names` table to be the enum values
}

so if I have 3 name columns in my Names table called Bob, Nick, Jamie those names would become the enum values so I can call something like Names.NAME.

Thanks.

  • 1
    `No. Enums are always fixed at compile-time. The only way you could do this would be to dyamically generate the relevant bytecode.` https://stackoverflow.com/questions/851466/populate-an-enum-with-values-from-database – parsecer Nov 28 '19 at 02:24
  • Possible duplicate of [Generating Enums Dynamically](https://stackoverflow.com/questions/8467215/generating-enums-dynamically) – Max Peng Nov 28 '19 at 02:26

0 Answers0