62,614
社区成员
发帖
与我相关
我的任务
分享
<hibernate-mapping package="cn.itcast.bbs.domain">
<class name="Article" abstract="true" table="itcast_article">
<cache usage="read-write" />
<id name="id" column="id_">
<generator class="uuid" />
</id>
<property name="title" column="title_" length="255" />
<list name="attachments" lazy="false" cascade="all">
<cache usage="read-write" />
<key column="articleId_" />
<list-index column="idx_"></list-index>
<one-to-many class="Attachment" />
</list>
</class>
</hibernate-mapping>
public abstract class Article {
private String id;
private String title; // 标题
private String content;// 内容
private User author;// 作者
private Date postTime;// 发表时间
private String ipAddr;// 发表文章时所用的IP地址
private boolean deleted; // 是否已被删除
private List<Attachment> attachments = new ArrayList<Attachment>(0); // 附件
}