read-Atleap-1-数据库结构

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)      |      |     |         |       |

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

 

 

注:在POJOContentField中出现了addupdatedeleteDAO应该处理的方法,不好。

 

 

2>ContentFieldValue

    table="field_value"

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

    和(2Page组成多对多关系,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-manydocument是主控制方

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

| 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-manyresource表为主控制方

    (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-manyContentField为主控制方

    MenuItem组成one-to-manyMenuItem为主控制方

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

| 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_pagecontent_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 |      |     |         |       |

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值