DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Thomas has posted 33 posts at DZone. View Full User Profile

JPA Mapping Of A HashMap Having A Enum Key

  • submit to reddit
  @CollectionTable(name="table_name", joinColumns=@JoinColumn(name="owner_fk"))
  @MapKeyColumn(name = "name", length = 50, nullable = false)
  @Column(name = "value", length = 100)
  private final Map<KeyEnum, String> metadata = new HashMap<KeyEnum, String>();