嗯。。搞定了注册和登录,说明我的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. PHP网页架站

    目前,Windows下已经有集成的PHP网页架站工具,例如:AppServ.WampServer.这些软件将Apache.PHP.MySQL.phpMyAdmin集成到一起,极大地方便了开发者架站.但 ...

  2. hdu5828 Rikka with Sequence

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=5828 [题解] 考虑bzoj3211 花神游历各国,只是多了区间加操作. 考虑上题写法,区间全为1打标记 ...

  3. 关于cocos2d-x 中 CCEditBox 的输入位置和IOS虚拟键盘位置不重合的bug

    这个文章的名字起的实在是有点长,主要是怕说不清楚. 在IOS上,输入时,我看到过的比较少,就两种,如附件两张图.一个是虚拟键盘的输入框完全是在CCEditBox上,另一张虚拟键盘的输入区域是紧挨着键盘 ...

  4. C# 文件类的操作---删除

    //删除文件夹 1这是最简单的方法 DirectoryInfo di = new DirectoryInfo(string Path); di.Delete(true); 注:path是你要删除的非空 ...

  5. 极致的 Hybrid:航旅离线包再加速!(转)

    资源离线的思路简单.场景复杂,最复杂的就是 H5 活动页面的离线化.Mobile Web 在弱网提速的唯一的办法就是坚决杜绝不必要的(运行时)网络请求,即除了 Json 格式的动态数据和其携带的商品配 ...

  6. Java8的Lambda表达式简介

    先阐述一下JSR(Java Specification Requests)规范,即Java语言的规范提案.是向JCP(Java Community Process)提出新增一个标准化技术规范的正式请求 ...

  7. aptitude约等于apt-get的工具

    如题,与之不同的是其会将依赖的程序也给删除. https://baike.baidu.com/item/aptitude/6849487?fr=aladdin 以下是一些常用 aptitude命令,仅 ...

  8. 去掉每行的特定字符py脚本

    百度下载一个脚本的时候遇到那么一个情况.每行的开头多了一个空格.https://www.0dayhack.com/post-104.html 一个个删就不要说了,很烦.于是就有了下面这个脚本. #! ...

  9. java===java基础学习(4)---字符串操作

    java中的字符串操作和python中的大致相同,需要熟悉的就是具体操作形式. 关于具体api的使用,详见:java===字符串常用API介绍(转) package testbotoo; public ...

  10. monkey测试===什么是monkey测试(系列一)转

    本文转自:http://www.cnblogs.com/liu-ke/p/4353926.html Monkey工具使用 一. 什么是Monkey Monkey是Android中的一个命令行工具,可以 ...