分享
 
 
 

read-Atleap-1-数据库结构

王朝java/jsp·作者佚名  2006-01-31
窄屏简体版  字體: |||超大  

Atleap是使用AppFuse为框架的CMS(内容管理系统)。

● hibernate对应表关系

Ø com.blandware.atleap.model.core.ContentLocale.对应locale表

Ø com.blandware.atleap.model.core.ResourceData. 对应resource_data表

Ø com.blandware.atleap.model.core.ContentField. 对应field表

Ø com.blandware.atleap.model.core.User. 对应app_user表

Ø com.blandware.atleap.model.core.ContentFieldValue. 对应field_value表

Ø com.blandware.atleap.model.core.Localizable. 对应localizable表

com.blandware.atleap.model.core.MailTemplate对应mail_template表

com.blandware.atleap.model.core.MenuItem对应menu_item表

com.blandware.atleap.model.core.Page对应page表

com.blandware.atleap.model.core.ActionPage对应action_page表

com.blandware.atleap.model.core.ContentPage对应content_page表

com.blandware.atleap.model.news.NewsItem对应news_item表

com.blandware.atleap.model.core.Layout对应layout表

Ø com.blandware.atleap.model.core.Role. 对应role表

Ø com.blandware.atleap.model.core.ContentResource. 对应resource表

com.blandware.atleap.model.core.ContentImage对应image表

com.blandware.atleap.model.core.ContentDocument对应document表

Ø com.blandware.atleap.model.core.UserCookie. 对应user_cookie表

Ø com.blandware.atleap.model.core.GlobalProperty. 对应global_property表

● 主要表结构

1>ContentField

table="field"

+----------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+--------------+------+-----+---------+-------+

| id | bigint(20) | | PRI | 0 | |主键

| version | bigint(20) | | | 0 | |锁键

| identifier | varchar(255) | | | | |

| localizable_id | bigint(20) | | MUL | 0 | |owner many-to-one

| type | tinyint(4) | | | 0 | |

| internal | char(1) | | | | |

+----------------+--------------+------+-----+---------+-------+

注:在POJO类ContentField中出现了add、update、delete等DAO应该处理的方法,不好。

2>ContentFieldValue

table="field_value"

和(1)ContentResource组成多对多关系,field_value是主控制方

和(2)Page组成多对多关系,field_value是主控制方

+-------------------+--------------+------+-----+---------------------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------------------+-------+

| id | bigint(20) | | PRI | 0 | |key

| version | bigint(20) | | | 0 | |

| locale_identifier | varchar(255) | YES | MUL | NULL | |many-to-one

| value | mediumblob | YES | | NULL | |

| simple_value | varchar(255) | YES | | NULL | |

| field_id | bigint(20) | YES | MUL | NULL | |many-to-one

| last_updated | datetime | | | 0000-00-00 00:00:00 | |

+-------------------+--------------+------+-----+---------------------+-------+

中间表1

+----------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+------------+------+-----+---------+-------+

| field_value_id | bigint(20) | | MUL | 0 | |关联键

| resource_id | bigint(20) | | MUL | 0 | |关联键

+----------------+------------+------+-----+---------+-------+

中间表2

+----------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+------------+------+-----+---------+-------+

| field_value_id | bigint(20) | | MUL | 0 | |关联键

| page_id | bigint(20) | | MUL | 0 | |关联键

+----------------+------------+------+-----+---------+-------+

3>ContentLocale

table="locale"

和field_value表组成one-to-many,field_value是主控制方

和document表组成one-to-many,document是主控制方

+------------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+------------------+--------------+------+-----+---------+-------+

| identifier | varchar(255) | | PRI | | |key

| version | bigint(20) | | | 0 | |

| name | varchar(255) | | UNI | | |

| default_instance | char(1) | | | | |

| active | char(1) | | | | |

+------------------+--------------+------+-----+---------+-------+

4>ContentResource

table="resource"

和resource_data组成one-to-one

和(1)role表组成many-to-many,resource表为主控制方

和(2)field_value表组成many-to-many, resource表为主控制方

和(3)MenuItem表组成many-to-many, resource表为主控制方

+---------------+--------------+------+-----+---------------------+-------+

| Field | Type | Null | Key | Default | Extra |

+---------------+--------------+------+-----+---------------------+-------+

| id | bigint(20) | | PRI | 0 | |key

| version | bigint(20) | | | 0 | |

| identifier | varchar(255) | | UNI | | |

| description | varchar(255) | YES | | NULL | |

| size | bigint(20) | | | 0 | |

| mimetype | varchar(255) | | | | |

| type | varchar(255) | | | | |

| usage_counter | int(11) | YES | | NULL | |

| last_updated | datetime | | | 0000-00-00 00:00:00 | |

+---------------+--------------+------+-----+---------------------+-------+

中间表1

+-------------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------+-------------+------+-----+---------+-------+

| resource_id | bigint(20) | | MUL | 0 | |

| rolename | varchar(20) | | MUL | | |

+-------------+-------------+------+-----+---------+-------+

中间表2:field_value_resource

+----------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+------------+------+-----+---------+-------+

| field_value_id | bigint(20) | | MUL | 0 | |

| resource_id | bigint(20) | | MUL | 0 | |

+----------------+------------+------+-----+---------+-------+

中间表3

+--------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------------+------------+------+-----+---------+-------+

| resource_id | bigint(20) | | MUL | 0 | |

| menu_item_id | bigint(20) | | MUL | 0 | |

+--------------+------------+------+-----+---------+-------+

5>GlobalProperty

table="global_property"

+----------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+--------------+------+-----+---------+-------+

| property_name | varchar(255) | | PRI | | |

| version | bigint(20) | | | 0 | |

| property_value | varchar(255) | YES | | NULL | |

+----------------+--------------+------+-----+---------+-------+

6>Localizable

table="localizable"

和ContentField组成one-to-many,ContentField为主控制方

和MenuItem组成one-to-many,MenuItem为主控制方

+------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+------------+--------------+------+-----+---------+-------+

| id | bigint(20) | | PRI | 0 | |

| version | bigint(20) | | | 0 | |

| class_name | varchar(255) | YES | | NULL | |

+------------+--------------+------+-----+---------+-------+

7>ResourceData

table="resource_data"

+----------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------+------------+------+-----+---------+-------+

| id | bigint(20) | | PRI | 0 | |

| raw_data | mediumblob | | | | |

+----------+------------+------+-----+---------+-------+

1>次表

ContentDocument

table:document

joined-subclass

+-------------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------+-------+

| resource_id | bigint(20) | | PRI | 0 | |主键

| locale_identifier | varchar(255) | YES | MUL | NULL | |关联表外键:many-to-one:column="locale_identifier"

| charset | varchar(255) | | | | |

+-------------------+--------------+------+-----+---------+-------+

2>ContentImage

table="image"

joined-subclass

+-------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------+------------+------+-----+---------+-------+

| resource_id | bigint(20) | | PRI | 0 | |

| width | int(11) | | | 0 | |

| height | int(11) | | | 0 | |

+-------------+------------+------+-----+---------+-------+

3>ContentPage

table="content_page"

+-----------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-----------+------------+------+-----+---------+-------+

| page_id | bigint(20) | | PRI | 0 | |

| layout_id | bigint(20) | | MUL | 0 | |many-to-one

+-----------+------------+------+-----+---------+-------+

3>Layout

table="layout"

和content_page组成content_page,content_page为主控制方

+----------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+--------------+------+-----+---------+-------+

| localizable_id | bigint(20) | | PRI | 0 | |

| definition | varchar(255) | | UNI | | |

| cpDefinition | varchar(255) | YES | | NULL | |

| name | varchar(255) | | UNI | | |

+----------------+--------------+------+-----+---------+-------+

4>MailTemplate

table="mail_template"

+----------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+--------------+------+-----+---------+-------+

| localizable_id | bigint(20) | | PRI | 0 | |

| identifier | varchar(255) | | UNI | | |

| mime_type | varchar(255) | | | | |

+----------------+--------------+------+-----+---------+-------+

5>MenuItem

table="menu_item"

+----------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+--------------+------+-----+---------+-------+

| localizable_id | bigint(20) | | PRI | 0 | |

| parent_id | bigint(20) | YES | MUL | NULL | |

| identifier | varchar(255) | YES | | NULL | |

| align | varchar(255) | YES | | NULL | |

| height | int(11) | YES | | NULL | |

| width | int(11) | YES | | NULL | |

| image | varchar(255) | YES | | NULL | |

| alt_image | varchar(255) | YES | | NULL | |

| action | varchar(255) | YES | | NULL | |

| forward | varchar(255) | YES | | NULL | |

| location | varchar(255) | YES | | NULL | |

| page | varchar(255) | YES | | NULL | |

| target | varchar(255) | YES | | NULL | |

| visibility | tinyint(4) | | | 0 | |

| position | int(11) | YES | | NULL | |

| js_onclick | varchar(255) | YES | | NULL | |

| js_onmouseover | varchar(255) | YES | | NULL | |

| js_onmouseout | varchar(255) | YES | | NULL | |

| orig_id | bigint(20) | YES | MUL | NULL | |

| owner_id | bigint(20) | YES | MUL | NULL | |

+----------------+--------------+------+-----+---------+-------+

6>Page

table="page"

+----------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+--------------+------+-----+---------+-------+

| localizable_id | bigint(20) | | PRI | 0 | |

| uri | varchar(255) | YES | MUL | NULL | |

| usage_counter | int(11) | YES | | NULL | |

| active | char(1) | | | | |

+----------------+--------------+------+-----+---------+-------+

● 主要表内容

Field表:(页面布局元素信息):

Ø optimistic-lock="version":该表加有乐观索,乐观锁版本为version字段

Ø Field表和field_value表是一对多关系,以field_id为关联字段,field_value是主

控制方。采用延迟(lazy)数据加载,级联delete操作。

Ø Field表和localizable表形成多对一关系,以localizable_id为管理字段。

+-----+---------+-------------+----------------+------+----------+

| id | version | identifier | localizable_id | type | internal |

+-----+---------+-------------+----------------+------+----------+

| 122 | 0 | from | 53 | 0 | T |

| 123 | 0 | subject | 53 | 0 | T |

| 124 | 0 | body | 53 | 1 | T |

| 125 | 0 | charset | 53 | 0 | T |

| 126 | 0 | title | 54 | 0 | T |

| 127 | 0 | description | 54 | 0 | T |

+-----+---------+-------------+----------------+------+----------+

● Field_value表:(具体页面元素信息)

Ø Field_value表和locale表是多对一关系,以identifier为关联键;

Ø Field_value表和field表是多对一关系,以field_id为关联键;

Ø Field_value表和page表是多对多关系,以field_value_page表为中间表。

Field_value表为主控制方。不级联。

Ø Field_value表和resource表是多对多关系,以field_value_resource表为中间表。

Ø field_value_page表(中间表)结构

+----------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+------------+------+-----+---------+-------+

| field_value_id | bigint(20) | | MUL | 0 | |

| page_id | bigint(20) | | MUL | 0 | |

+----------------+------------+------+-----+---------+-------+

Ø field_value_resource表(中间表)结构

+----------------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------------+------------+------+-----+---------+-------+

| field_value_id | bigint(20) | | MUL | 0 | |

| resource_id | bigint(20) | | MUL | 0 | |

+----------------+------------+------+-----+---------+-------+

Ø resource表

● locale表

Ø locale表和Field_value表是一对多关系

+------------+---------+----------------+------------------+--------+

| identifier | version | name | default_instance | active |

+------------+---------+----------------+------------------+--------+

| en | 0 | English | T | T |

| ru | 0 | 袪褍褋褋泻懈泄 | F | T |

+------------+---------+----------------+------------------+--------+

Ødocument表(中间表)

locale表和document表是一对多关系

+-------------------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------+-------+

| resource_id | bigint(20) | | PRI | 0 | |

| locale_identifier | varchar(255) | YES | MUL | NULL | |

| charset | varchar(255) | | | | |

+-------------------+--------------+------+-----+---------+-------+

● Localizable表

+----+---------+----------------------------------------------+

| id | version | class_name |

+----+---------+----------------------------------------------+

| 0 | 0 | com.blandware.atleap.model.core.Layout |

| 2 | 0 | com.blandware.atleap.model.core.ActionPage |

| 3 | 0 | com.blandware.atleap.model.core.ActionPage |

| 4 | 1 | com.blandware.atleap.model.core.ContentPage |

| 11 | 9 | com.blandware.atleap.model.core.MenuItem |

| 12 | 9 | com.blandware.atleap.model.core.MenuItem |

| 13 | 9 | com.blandware.atleap.model.core.MenuItem |

● resource_data表

+----------+------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+----------+------------+------+-----+---------+-------+

| id | bigint(20) | | PRI | 0 | |

| raw_data | mediumblob | | | | |

+----------+------------+------+-----+---------+-------+

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有