is there any way to persist the map with dymamic fields.Here is sample code
Table :
A table with more than 200 fields.
POJO :
<code>
<pre>
public class DynamicEntity {
private Long id;
private Map<String,String> fields = new HashMap();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void add(String key,String value){
fields.put(key,value);
}
}
</pre>
動的フィールドを保持する pojo のマップ。トランザクション コード ..
GenericData data = new GenericData();
data.addField("name", "CF");
data.addField("description", "CF-USA");
data.addField("server", "ServerName");
//get the session
session.save(data);
pojo を保存するときに、ここにマップを保存する方法はありますか?ここでは、すべてのフィールドが動的であるため、hbm ファイルでフィールドが構成されていません。
私の基本的な考えは、hbm ファイルで 200 フィールドを構成しないことです。
Regards,
Ravi.