In theory, it can be done, but it doesn't make much sense.
The members (properties) of a class have to be mapped to columns on a BD, and those columns are fixed in the table, while the key/values you put in a Map are not.
Maps are good to persist collections of children objects, because you have a known column (which is the key) and an additional table to contain child objects. But making a map itself a persistent class is not something you can easily represent in a table.
If what you are attempting, is to define your data model dynamically with maps instead of fixed classes, you might consider "dynamic models" with maps (Item 4.4 in the documentation).
_________________ Gonzalo Díaz
|