v 新闻实体类
Ø 数据结构描述
ª 通过继承Page和Localizable,NewsItem完成新闻实体
ª 通过继承、映射和引用NewsItem并不真正的保存新闻信息
ª ContentFieldVale保存真正的新闻内容,包括标题、注释和内容体等
ª ContentField保存布局信息,和ContentFieldVale形成引用关系,完成显示布局和内
容的分离
Ø新闻实体类图
Ø新闻实体主要数据库表
ØLocalizable.hbm.xml
<hibernate-mapping
>
<class
name="com.blandware.atleap.model.core.Localizable"
table="localizable"
lazy="false"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<cache usage="read-write" />
<id
name="id"
column="id"
type="java.lang.Long"
unsaved-value="null"
>
</id>
<version
name="version"
type="long"
column="version"
access="property"
unsaved-value="null"
/>
<property
name="className"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="class_name"
/>
<!—子类->
<joined-subclass
name="com.blandware.atleap.model.core.Page"
table="page"
dynamic-update="false"
dynamic-insert="false"
lazy="false"
>
<key
column="localizable_id"
/>
<property
name="uri"
type="java.lang.String"
update="true"
insert="true"
access="property"
>
<column
name="uri"
not-null="false"
unique="true"
/>
</property>
<property
name="usageCounter"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="usage_counter"
not-null="false"
/>
<property
name="active"
type="true_false"
update="true"
insert="true"
access="property"
column="active"
not-null="true"
/>
<bag
name="linkedContentFieldValues"
table="field_value_page"
lazy="true"
inverse="false"
cascade="none"
>
<key
column="page_id"
>
</key>
<many-to-many
class="com.blandware.atleap.model.core.ContentFieldValue"
column="field_value_id"
outer-join="auto"
/>
</bag>
<bag
name="linkedMenuItems"
table="menu_item_page"
lazy="true"
inverse="false"
cascade="none"
>
<key
column="page_id"
>
</key>
<many-to-many
class="com.blandware.atleap.model.core.MenuItem"
column="menu_item_id"
outer-join="auto"
/>
</bag>
<!—Localizable的子类Page的子类-->
<joined-subclass
name="com.blandware.atleap.model.news.NewsItem"
table="news_item"
dynamic-update="false"
dynamic-insert="false"
lazy="false"
>
<key
column="page_id"
/>
<property
name="publicationDate"
type="date"
update="true"
insert="true"
access="property"
column="publication_date"
not-null="false"
/>
</joined-subclass>
</joined-subclass>
</class>