Hi,
I'm having trouble getting an entity up and running. I have a "TextEntity" that has an id and a Language->String map, like this:
Code:
@Entity
public class TextEntity implements Serializable {
@Id
public Long getId() { ... }
public Map<String, String> getTranslations() { ... }
}
When deploying, I'm getting the following error message:
javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.Map, for columns: [org.hibernate.mapping.Column(translations)]
How can I accomplish this? I would like to keep it all in a single table, looking like this:
Code:
-----------------------------
| ID | LANGUAGE | VALUE |
|---------------------------|
| 1 | en | Hi |
| 1 | sv | Hej |
-----------------------------
So, in essence I have a composite primary key (ID, LANGUAGE), where the seccond element should be the key in the table.