I have a entity bean
@Entity
@Table(name="info")
public class Info{
@Column(name="name", nullable = false)
private String name;
}
I am using this bean with hibernate to store the object value in database. However I have a requirement to convert the bean as JSON like this
{
"param1":"AB_9999"
}
instead of
{
"name":"AB_9999"
}
I don't want to change the column name but also want the JSON should have 'param1' instead of 'name' as key.
I can already convert the bean to JSON only thing I wish to know is,
How to change the key name dynamically ?