@Entity(name = "catalog_value")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@Immutable
public class CatalogValue {
@EmbeddedId
@AttributeOverride(name = "uuid", column = @Column(name = "id", updatable = false, nullable = false, columnDefinition = "CHAR(36)"))
private CatalogValueId id;
@Immutable
@ElementCollection
@CollectionTable(name = "catalog_value_metadata", joinColumns = {
@JoinColumn(name = "catalog_value_id", referencedColumnName = "id") })
@MapKeyColumn(name = "`key`")
@AttributeOverride(name = "value.value", column = @Column(name = "`value`"))
@AttributeOverride(name = "value.isPublic", column = @Column(name = "is_public"))
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
private Map<String, MetadataValue> metadata = new HashMap<>();
[...]
}