There have been a few previous problems with using JPA to map members in entity, and some annotations are easy to confuse, so keep this in mind.
1. Mapping of Map<string,string>
The key and value of this map are both string types, or other underlying types, and can be mapped using the following method:
@ElementCollection
@CollectionTable (name= "table_name")
@MapKeyColumn (name= "Propkey")
@Column (name= "PropValue")
private map<string,string> properties = new hashmap<string,string> ();
2. Mapping of Map<string,object>
Key is the underlying type, value is the object
@OneToMany
@JoinTable (name= "Amplifier_prop", inversejoincolumns= @JoinColumn (name= "PropValue"))
@ Mapkeycolumn (name= "Propkey")
private map<string,dataconverter> properties = new Hashmap<string, Dataconverter> ();
3. Mapping of Map<object,object>
Both key and value are objects
@OneToMany
@JoinTable (name= "Testentity_prop", inversejoincolumns= @JoinColumn (name= "PropValue"))
@ Mapkeyjoincolumn (name= "amplifier_id")
private map<amplifier,dataconverter> props = new hashmap< Amplifier, dataconverter> ();
4. Mapping of Map<object,string>
Key is an object, value is a string or other underlying type
@ElementCollection
@CollectionTable (name= "table_name")
@MapKeyJoinColumn (name= "Propkey")
@Column ( Name= "PropValue")
private map<amplifier,string> properties = new hashmap<amplifier,string> ();
When a key is an underlying type or a non-basic type, note @mapkeycolumn and @mapkeyjoincolumn are used exclusively for the underlying type, such as Integer or string, and the latter is for object
When value is an object, use the @onetomany form of the annotation method
The above 4 kinds of ways I have tested, no problem. There should be other ways, lazy to go to Google's just as I write it.