Hibernate version: 3.0
Name and version of the database you are using: MySql
I'm looking for an example of how to set up my annotations to hibernate a simple java hashmap to a MySql database.
Given an extremely simple class as defined below, what should the annotations be to cause this to hibernate the HashMap propHash correctly.
Any help would be very, very appreciated.... Thanks!
Mike
{
Code:
import ...;
/**
*
* @hibernate.class
* table="MYCLASS"
*
*/
public class MyClass extends MyBaseClass implements Serializable
{
private Long myClassId;
private String myClassNickName;
private HashMap<Integer, String> propHash = new HashMap<Integer,String>();
public void setMyClassId(Long id)
{
myClassId = id;
}
/**
*
* @hibernate.property
*
**/
public Long getMyClassId() { return myClassId; }
public void setMyClassNickName(String sName)
{
myClassNickName = sName;
}
/**
*
* @hibernate.property
*
**/
public String getMyClassNickName() { return myClassNickName };
public void setPropHash(HashMap map)
{
propHash = map;
}
/**
*
* // what here?
*
**/
public HashMap getPropHash()
{
return propHash;
}
public myClass() { super() };
}