i'm super low level. so i can't this easy prolbelm. OTL..
i want to make usefull custom type at next mapping file.
Code:
<class name="ReservedContents" table="SYSTEM_CONTENTS">
<id name="seq" column="SSC_CONTENTS_SEQ_FK">
<generator class="native"></generator>
</id>
<property name="type" column="SSC_TYPE" type="ContentsEntryType">
<column name="code" />
</property>
<property name="description" column="SSC_DESCRIPTION" />
</class>
belowe code i smy java class.
plz, convert this class to custom type class.
Code:
public class ContentsEntryType {
public static final ContentsEntryType CONTENTS = new ContentsEntryType("CONTENTS");
public static final ContentsEntryType RECYCLEBIN = new ContentsEntryType("RECYCLEBIN");
public static final ContentsEntryType WORKBIN = new ContentsEntryType("WORKBIN");
private final String _code;
private ContentsEntryType(String code) {
this._code = code;
}
public String getCode() {
return _code;
}
public String toString() {
return _code;
}
}
next is using example.
Code:
ReservedContents contents = new ReservedContents();
contents.setType(ContentsEntryType.RECYCLEBIN);
session.save(contetns);
thank you.