I have a table in my MySQL containing calculated values. At the moment this is a Decimal field.
But now I’ll need this table to also hold calculated dates, booleans etc.
What’s the best solution here, just change the MySQL field type to a VARCHAR and handle the rest in my Java code. Or am I gonna get me in a mess with this approach?
Any ideas and pointers are welcome!
Use a single column per datatype and introduce a discriminator column stating which of the datatype columns should be referenced. The discriminator column can simply be an int representing an enumeration of possible datatypes.