嗯。。搞定了注册和登录,说明我的SSH整合已经没有问题了,那么我就继续折腾了。

我的目的是用SSH框架写一个论坛(当然是功能最简单的那种),搞定了整合之后我打算先做出一些基本的功能,于是我就先简单的设计了一下数据库。

 /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2015/9/17 17:21:07 */
/*==============================================================*/ drop table if exists BM; drop table if exists borad; drop table if exists post; drop table if exists reply; drop table if exists userinfo; /*==============================================================*/
/* Table: BM */
/*==============================================================*/
create table BM
(
BM_id int not null,
user_id int,
borad_id int,
primary key (BM_id)
); /*==============================================================*/
/* Table: borad */
/*==============================================================*/
create table borad
(
borad_id int not null,
borad_name char(20) not null,
primary key (borad_id)
); /*==============================================================*/
/* Table: post */
/*==============================================================*/
create table post
(
post_id int not null,
user_id int,
borad_id int,
post_title char(20) not null,
post_createtime timestamp not null,
post_updatetime timestamp not null,
post_replytime timestamp not null,
post_readtimes int not null,
post_content char(200),
primary key (post_id)
); /*==============================================================*/
/* Table: reply */
/*==============================================================*/
create table reply
(
reply_id int not null,
post_id int,
user_id int,
reply_content char(200) not null,
reply_createtime timestamp not null,
primary key (reply_id)
); /*==============================================================*/
/* Table: userinfo */
/*==============================================================*/
create table userinfo
(
user_id int not null,
user_name char(20) not null,
user_passwrod char(20) not null,
user_nickname char(20) not null,
user_image char(50) not null,
primary key (user_id)
); alter table BM add constraint FK_Relationship_1 foreign key (user_id)
references userinfo (user_id) on delete restrict on update restrict; alter table BM add constraint FK_Relationship_2 foreign key (borad_id)
references borad (borad_id) on delete restrict on update restrict; alter table post add constraint FK_Relationship_4 foreign key (user_id)
references userinfo (user_id) on delete restrict on update restrict; alter table post add constraint FK_Relationship_5 foreign key (borad_id)
references borad (borad_id) on delete restrict on update restrict; alter table reply add constraint FK_Relationship_6 foreign key (post_id)
references post (post_id) on delete restrict on update restrict; alter table reply add constraint FK_Relationship_7 foreign key (user_id)
references userinfo (user_id) on delete restrict on update restrict;

这是用PowerDesigner创建了LogicalModel然后生成的MySql代码。*.hbm.xml就不放上来了。

一个菜鸟正在用SSH写一个论坛(1)的更多相关文章

  1. 一个菜鸟正在用SSH写一个论坛(2)

    额 一不小心又一个多月没有写过随笔了. 这次是在某次启动服务器的时候报错了: 严重: Exception starting filter struts2 Unable to load configur ...

  2. 一个.java文件内只能写一个class吗

    先给结论:当然不是!! 可以有多个类,但只能有一个public的类,并且public的类名必须与文件名相一致.一个文件中可以不含public类,如果只有一个非public类,此时可以跟文件名不同. 为 ...

  3. 第一个Three.js程序——动手写一个简单的场景

    三维场景基本要素: 步骤: 代码: 源码: <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  4. 如何写一个SSH项目(一)程序设计大体思路

    SSH:分别是指Spring,Struts,Hibernate. 后来Struts2代替了Struts,所以我们常说的SSH是指Spring,Struts2,Hibenate. 其中Spring一般用 ...

  5. 自己动手写一个iOS 网络请求库的三部曲[转]

    代码示例:https://github.com/johnlui/Swift-On-iOS/blob/master/BuildYourHTTPRequestLibrary 开源项目:Pitaya,适合大 ...

  6. 手写一个Promise/A+,完美通过官方872个测试用例

    前段时间我用两篇文章深入讲解了异步的概念和Event Loop的底层原理,然后还讲了一种自己实现异步的发布订阅模式: setTimeout和setImmediate到底谁先执行,本文让你彻底理解Eve ...

  7. 写一个有字符界面的ssh链接工具

    大概的样子 这是大致的样子- 写之前想说的 因为个人工作的的电脑是deepin系统的,系统本身的命令行非常好用,用第三方的ssh工具用不习惯,就想自己写一个. shell脚本是第一次写,写的不是很好, ...

  8. 【转】用C写一个简单病毒

    [摘要]在分析病毒机理的基础上,用C语言写了一个小病毒作为实例,用TURBOC2.0实现. [Abstract] This paper introduce the charateristic of t ...

  9. 分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”

    这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...

随机推荐

  1. 数据结构:hash_map

    在C++11以上的开发环境中,请直接把map替换成unordered_map,不要使用hash_map 之前我们专门有一篇介绍哈希表,多维哈希表的博文,当时就是以map举例子,然后说了一句把map替换 ...

  2. 解决nginx在记录post数据时 中文字符转成16进制的问题【转载】

    1. 问题描述 nginx 在获取post数据时候,如果是中文,则转换成16进制显示在日志文件中,如下图所示.   Paste_Image.png 日志格式为: log_format postdata ...

  3. NGINX: Primary script unknown

    参考: [ StackExchange ] 这里的解决方式应该是你排查了所有原因依然无法解决问题. SELINUX 更改 selinux 配置 chcon -R -t httpd_sys_conten ...

  4. java 连接数据库报错:Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '

    1.解决方法: 报错信息为: Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server ti ...

  5. javascript中的addEventListener与attchEvent

    1.addEventListener 该方法用于向指定元素添加事件句柄 浏览器的支持情况为chrome1.0.ie9+.fireFox1.0.opera7.0 该方法包含三个参数event, func ...

  6. javascript中break和continue

    1.break break语句会立即退出循环,强制执行循环后面的语句 var num = 0; for(var i=1;i<10;i++){ if(i%5 == 0){ break; } num ...

  7. Java 中的静态内部类

    静态内部类是 static 修饰的内部类,这种内部类的特点是: 1. 静态内部类不能直接访问外部类的非静态成员,但可以通过 new 外部类().成员 的方式访问 2. 如果外部类的静态成员与内部类的成 ...

  8. LCD实验学习笔记(九):UART

    s3c2440包含三个通用异步收发器,可工作于中断模式或DMA模式.每个UART包含两个64字节的FIFOs用于接收和发送数据.可编程设置波特率.1或2个停止位,5/6/7/8个数据位和奇偶校验状态. ...

  9. Python模块学习 - Functools

    Functools模块 Higher-order functions and operations on callable objects,看这个标题我都是懵逼的,这都是啥啥啥啊,赶紧拿出百度翻译:可 ...

  10. Coursera助学金申请模板

    讲真,我觉得coursera的课还挺贵的.但是它有助学金系统,非常对我们穷学生友好了,而且基本上申请的都会批.不过现在助学金需要15个工作日才有答复,所以注意要提前申请. 有两大段要填. 虽然写的挺烂 ...