1. Some skills in design class. A very similar thing, you can also get two of the entity. Because in many cases, the design of the database is very different from the interface used in the face.
In this case, you can design different entity for the two parties, and then assign values to each other and call each other separately. Will make the design idea become more clear.
2, for the list "Object" type. A database can only be a string (a string in which the data must be converted by a JSON object)
There is no need for a string attribute in the entity, only a list of "Object" can be. However, you need to manually add a method for the set string, so that Java reflection automatically calls the method, generating the corresponding string.
such as type list<object>. Set method Setobjectstr, which implements the action of the object to JSON string.
When the data is in storage, the deposit variable is named OBJECTSTR, so the reflector will call the method automatically.
Fantastic!
The specific code is empty add!
Java EE entity design, list<object> type storage method