一个菜鸟正在用SSH写一个论坛(1)
嗯。。搞定了注册和登录,说明我的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)的更多相关文章
- 一个菜鸟正在用SSH写一个论坛(2)
额 一不小心又一个多月没有写过随笔了. 这次是在某次启动服务器的时候报错了: 严重: Exception starting filter struts2 Unable to load configur ...
- 一个.java文件内只能写一个class吗
先给结论:当然不是!! 可以有多个类,但只能有一个public的类,并且public的类名必须与文件名相一致.一个文件中可以不含public类,如果只有一个非public类,此时可以跟文件名不同. 为 ...
- 第一个Three.js程序——动手写一个简单的场景
三维场景基本要素: 步骤: 代码: 源码: <!DOCTYPE html> <html lang="en"> <head> <meta c ...
- 如何写一个SSH项目(一)程序设计大体思路
SSH:分别是指Spring,Struts,Hibernate. 后来Struts2代替了Struts,所以我们常说的SSH是指Spring,Struts2,Hibenate. 其中Spring一般用 ...
- 自己动手写一个iOS 网络请求库的三部曲[转]
代码示例:https://github.com/johnlui/Swift-On-iOS/blob/master/BuildYourHTTPRequestLibrary 开源项目:Pitaya,适合大 ...
- 手写一个Promise/A+,完美通过官方872个测试用例
前段时间我用两篇文章深入讲解了异步的概念和Event Loop的底层原理,然后还讲了一种自己实现异步的发布订阅模式: setTimeout和setImmediate到底谁先执行,本文让你彻底理解Eve ...
- 写一个有字符界面的ssh链接工具
大概的样子 这是大致的样子- 写之前想说的 因为个人工作的的电脑是deepin系统的,系统本身的命令行非常好用,用第三方的ssh工具用不习惯,就想自己写一个. shell脚本是第一次写,写的不是很好, ...
- 【转】用C写一个简单病毒
[摘要]在分析病毒机理的基础上,用C语言写了一个小病毒作为实例,用TURBOC2.0实现. [Abstract] This paper introduce the charateristic of t ...
- 分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”
这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...
随机推荐
- jenkins修改job默认名字
${GIT_BRANCH,fullName="false"}-${BUILD_NUMBER}-${GIT_REVISION,length=12}-${deploy_rollback ...
- 【BZOJ】3971 [WF2013]Матрёшка
[算法]区间DP [题解] 参考写法:BZOJ 3971 Матрёшка 解题报告 第二个DP可以预处理mex优化到O(nM+n2),不过我懒…… 第一个DP有另一种写法:不预处理,在一个n2取出来 ...
- vue双向数据绑定的原理-object.defineProperty() 用法
有关双向数据绑定的原理 关于数据双向绑定的理解:利用了 Object.defineProperty() 这个方法重新给对象定义了新属性,在操作新属性分别为为获取属性值(调用get方法)和设置属性值(调 ...
- VMware12序列号
VMware tools怎么删除 rpm -e open-vm-tools-desktop vm12序列号 5A02H-AU243-TZJ49-GTC7K-3C61NVF5XA-FNDDJ-085GZ ...
- 移动端测试===Android内存管理: 理解App的PSS
Android内存管理: 理解App的PSS 原文链接:http://www.littleeye.co/blog/2013/06/11/android-memory-management-unders ...
- xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance(xsi:schemaLocation详解)
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"中xsi的意思是 :本xml文件中要用到某些来自xsi代表的“http:/ ...
- BZOJ 3656: 异或 (组合数取模 CRT)
http://www.lydsy.com/JudgeOnline/problem.php?id=3656 大意:经过一通推导,问题变成求\[\binom N M \mod P\],其中N,M<= ...
- HDU 5117 Fluorescent
题目链接:HDU-5117 题意为有n盏灯,m个开关,每个开关控制着\( k_{i} \)灯.X为最后亮着的灯的个数,要求出\( E(X^{3} ) * 2^{M} mod (10^9 + 7) \) ...
- 图论-最小生成树-Kruskal算法
有关概念: 最小生成树:在连通图G中,连接图G所有顶点且总权最小的边构成的树 思路: 首先对边按权从小到大排序,紧接着枚举每一条边,如果两个结点的祖先结点不同(并查集),则连上此边,直到边数等于结点数 ...
- Xcode7 iOS9.0 的真机调试
Xcode7的真机调试: 1.Xcode偏好 -> 账号 -> 增加 Apple ID ->显示 free 2.Target 运行 iOS 版本号 3.修正 Team 项 选择 ...