首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

游天上网分析

2012-11-16 
游天下网分析又去了福州一个星期,加油!继续吧!经过分析暂时知道这个项目大体需要两个实体(POJO):对于商人

游天下网分析
   又去了福州一个星期,加油!继续吧!
    经过分析暂时知道这个项目大体需要两个实体(POJO):对于商人而言的商品店,用于商人上传店的资料以便游客查询。另一个就是游客实体,用于留言、评论、开博客交友写文章等。
    生成SQL如下:
    /*==============================================================*/
/* DBMS name:      Sybase AS Anywhere 9                         */
/* Created on:     2008-3-24 20:51:38                           */
/*==============================================================*/


if exists(select 1 from sys.sysforeignkey where role='FK_SHOP_商店关联行业_TRADE') then
    alter table shop
       delete foreign key FK_SHOP_商店关联行业_TRADE
end if;

if exists(
   select 1 from sys.sysindex i, sys.systable t
   where i.table_id=t.table_id
     and i.index_name='ActivateCode_PK'
     and t.table_name='ActivateCode'
) then
   drop index ActivateCode.ActivateCode_PK
end if;

if exists(
   select 1 from sys.sysindex i, sys.systable t
   where i.table_id=t.table_id
     and i.index_name='Email_PK'
     and t.table_name='Email'
) then
   drop index Email.Email_PK
end if;

if exists(
   select 1 from sys.sysindex i, sys.systable t
   where i.table_id=t.table_id
     and i.index_name='shop_PK'
     and t.table_name='shop'
) then
   drop index shop.shop_PK
end if;

if exists(
   select 1 from sys.sysindex i, sys.systable t
   where i.table_id=t.table_id
     and i.index_name='商店关联行业_FK'
     and t.table_name='shop'
) then
   drop index shop.商店关联行业_FK
end if;

if exists(
   select 1 from sys.sysindex i, sys.systable t
   where i.table_id=t.table_id
     and i.index_name='tour_PK'
     and t.table_name='tour'
) then
   drop index tour.tour_PK
end if;

if exists(
   select 1 from sys.sysindex i, sys.systable t
   where i.table_id=t.table_id
     and i.index_name='trade_PK'
     and t.table_name='trade'
) then
   drop index trade.trade_PK
end if;

if exists(
   select 1 from sys.systable
   where table_name='ActivateCode'
     and table_type in ('BASE', 'GBL TEMP')
) then
    drop table ActivateCode
end if;

if exists(
   select 1 from sys.systable
   where table_name='Email'
     and table_type in ('BASE', 'GBL TEMP')
) then
    drop table Email
end if;

if exists(
   select 1 from sys.systable
   where table_name='shop'
     and table_type in ('BASE', 'GBL TEMP')
) then
    drop table shop
end if;

if exists(
   select 1 from sys.systable
   where table_name='tour'
     and table_type in ('BASE', 'GBL TEMP')
) then
    drop table tour
end if;

if exists(
   select 1 from sys.systable
   where table_name='trade'
     and table_type in ('BASE', 'GBL TEMP')
) then
    drop table trade
end if;

/*==============================================================*/
/* Table: ActivateCode                                          */
/*==============================================================*/
create table ActivateCode
(
    acode                varchar(1)                     not null,
    type                 varchar(1)                     not null,
    constraint PK_ACTIVATECODE primary key (acode)
);

/*==============================================================*/
/* Index: ActivateCode_PK                                       */
/*==============================================================*/
create unique index ActivateCode_PK on ActivateCode (
acode ASC
);

/*==============================================================*/
/* Table: Email                                                 */
/*==============================================================*/
create table Email
(
    sender               varchar(1)                     not null,
    receiver             varchar(1)                     not null,
    cc                   varchar(1)                     not null,
    body                 varchar(1)                     not null,
    sign                 varchar(1)                     not null,
    id                   integer                        not null,
    constraint PK_EMAIL primary key (id)
);

/*==============================================================*/
/* Index: Email_PK                                              */
/*==============================================================*/
create unique index Email_PK on Email (
id ASC
);

/*==============================================================*/
/* Table: shop                                                  */
/*==============================================================*/
create table shop
(
    shopcode             varchar(1)                     not null,
    tradecode            varchar(1),
    shopname             varchar(1)                     not null,
    shopadd              varchar(1)                     not null,
    trade                varchar(1)                     not null,
    constraint PK_SHOP primary key (shopcode)
);

/*==============================================================*/
/* Index: shop_PK                                               */
/*==============================================================*/
create unique index shop_PK on shop (
shopcode ASC
);

/*==============================================================*/
/* Index: 商店关联行业_FK                                             */
/*==============================================================*/
create  index 商店关联行业_FK on shop (
tradecode ASC
);

/*==============================================================*/
/* Table: tour                                                  */
/*==============================================================*/
create table tour
(
    tuserId              integer                        not null,
    tuserName            varchar(1),
    tsex                 char(1),
    tborn                date,
    isMarry              binary(1),
    tadd                 varchar(1),
    interself            varchar(1),
    career               varchar(1),
    blood                varchar(1),
    occu                 varchar(1),
    forte                varchar(1),
    tnature              varchar(1),
    hobby                varchar(1),
    email                varchar(1),
    phone                varchar(1),
    QQ                   integer,
    address              varchar(1),
    addcode              integer,
    realname             varchar(1),
    constraint PK_TOUR primary key (tuserId)
);

/*==============================================================*/
/* Index: tour_PK                                               */
/*==============================================================*/
create unique index tour_PK on tour (
tuserId ASC
);

/*==============================================================*/
/* Table: trade                                                 */
/*==============================================================*/
create table trade
(
    tradecode            varchar(1)                     not null,
    tradename            varchar(1)                     not null,
    constraint PK_TRADE primary key (tradecode)
);

/*==============================================================*/
/* Index: trade_PK                                              */
/*==============================================================*/
create unique index trade_PK on trade (
tradecode ASC
);

alter table shop
   add constraint FK_SHOP_商店关联行业_TRADE foreign key (tradecode)
      references trade (tradecode)
      on update restrict
      on delete restrict;


    经分析用例图、cdm图和pdm图分析如下:

热点排行