I would like to create several classes that are in the narrow shell of a map of a pair of key values. What is the best appoarch to retrieve or store these classes in a database using hiberate? What are the correct sleep mode annotations to get the job done?
In the database, I expect this to be data generation
class1, field1, value1 class2, field2, value2 class1, field2, somevalue1 ...
On the java side, I might have
@Table("some_db_table") class KeyValuePairs { private HashMap<String, String> map; ... } class Class1 extends KeyValuePairs { private Stirng id = "class1"; ... } class Class2 extends KeyValuePairs { private Stirng id = "class2"; ... }
source share