嗯。。搞定了注册和登录,说明我的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. 洛谷 P3730 曼哈顿交易

    https://www.luogu.org/problem/show?pid=3730 题目背景 will在曼哈顿开了一家交易所,每天,前来买卖股票的人络绎不绝. 现在,will想要了解持股的情况.由 ...

  2. python基础--结构篇

    在C/C++/Java中,main是程序执行的起点,Python中,也有类似的运行机制,但方式却截然不同: Python使用缩进对齐组织代码的执行,所有没有缩进的代码(非函数定义和类定义),都会在载入 ...

  3. 【hdu5217-括号序列】线段树

    题意:给一串括号,有2个操作,1.翻转某个括号.2.查询某段区间内化简后第k个括号是在原序列中的位置.1 ≤ N,Q ≤ 200000. 题解: 可以知道,化简后的序列一定是)))((((这种形式的. ...

  4. UOJ#179. 线性规划[模板]

    传送门 http://uoj.ac/problem/179 震惊,博主竟然还不会线性规划! 单纯形实在学不会啊……背个板子当黑盒用…… 学(chao)了NanoApe dalao的板子 #includ ...

  5. 解决vue代码缩进报错问题 关闭ESlint

    前言 使用vue-cli来构建单页SPA应用,提示代码缩进报错 原因分析 通过查看package.json文件我们可以发现,在文件中默认安装了eslint-loader模块,eslint-loader ...

  6. Python参数输入模块-optparse

    废话: 模块名是optparse, 很多人打成optparser.以至于我一直导入导入不了.搞的不知所以. 模块的使用: import optparse #usage 定义的是使用方法,%prog 表 ...

  7. [device tree] How to decompile a compiled .dtb (device tree blog) into .dts (device tree source).

    $ ./out/target/product/project_name/obj/KERNEL_OBJ/scripts/dtc/dtc -I dtb -O dts -o decompiled.dts ~ ...

  8. 檢查 cpu 的全部 gpio 狀態及設定

    $ adb root # cat /sys/kernel/debug/gpio

  9. 非 GUI 模式运行 JMeter 压力测试

    非 GUI 模式,即命令行模式,运行 JMeter 测试脚本能够大大缩减所需要的系统资源. 使用命令:jmeter -n -t <testplan filename> -l <lis ...

  10. 网站服务器压力Web性能测试(4):服务器压力Web性能测试小结

    1.Apache Bench,Webbench,http_load对网站压力Web性能进行测试时,为了得到更加客观和准确的数值,应该从远程访问.局域网访问和本地等多个方面进行全方位的测试.一般用127 ...