Hibernateを使用して列挙型のセットをデータベースに保存しようとしています。
列挙型は次のようなものです
public enum SomeEnum {
ITEM,
ITEM2,
}
そして、私はこのようなHibernateモデルエンティティを持っています
@Entity
public class TableObject implements BaseObject {
private Long id;
private Set<SomeEnum> someEnumSet;
@Column(name = "TABLE_COLUMN", nullable = true, insertable = true, updatable = true)
@ElementCollection
public Set<SomeEnum> getSectionSet() {
return sectionSet;
}
public void setSectionSet(Set<SomeEnum> sectionSet) {
this.sectionSet = sectionSet;
}
}
そして、@ElementCollectionアノテーションは正しくないと思います。'TABLE_COLUMN'列は、DB内のタイプCLOBです。(Oracle)。
ありがとう、アレックス。