一个菜鸟正在用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写一个简单的网页版“我的世界小游戏”
这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...
随机推荐
- jquery 条形码 插件jquery-barcode使用
转载文章 jquery 条形码 插件jquery-barcode使用 条码官网: http://barcode-coder.com/en/barcode-jquery-plugin-201.htm ...
- 【模版】多项式乘法 FFT
https://www.luogu.org/problem/show?pid=3803 题目背景 这是一道模版题 题目描述 给定一个n次多项式F(x),和一个m次多项式G(x). 请求出F(x)和G( ...
- 鸡尾酒排序Cocktail sort
鸡尾酒排序基于冒泡排序,双向循环 还是看例子吧,给定待排数组[2 3 4 5 1] 第一趟过去时的每一步 第一步迭代,2 < 3不换 [2 3 4 5 1] 第二步迭代,3 < 4不换 [ ...
- os.fork()
ret = os.fork() if ret == 0: child_suite # 子进程代码 else: parent_suite # 父进程代码 Python中的fork() 函数可以获得系统中 ...
- 【bzo1579】拆点+dijkstra优先队列优化+其他优化
题意: n个点,m条边,问从1走到n的最短路,其中有K次机会可以让一条路的权值变成0.1≤N≤10000;1≤M≤500000;1≤K≤20 题解: 拆点,一个点拆成K个,分别表示到了这个点时还有多少 ...
- Python 用ctypes观察Python对象的内存结构 -- (转)
!!!强烈推荐的好文章!!! 对象的两个基本属性 Python所有对象结构体中的头两个字段都是相同的: refcnt:对象的引用次数,若引用次数为0则表示此对象可以被垃圾回收了. typeid:指向描 ...
- 9.0docker的数据管理
dopcker容器的数据卷 为容器添加数据卷 sudo docker run -v ~/container data:/data -it ubuntu /bin/bash 查 ...
- 今天安装了arch,感觉不错,这速度可以
虽然没有想想中的那么那么快,不过已经可以了 总结一下遇到的问题以及i自己安装的软件 1.u盘硬盘不能自动挂载 安装gvfs 2.不能读写挂载 安装ntfs-3g 3.时间不对 照wiki上的说 #ln ...
- Python学习笔记 - day14 - Celery异步任务
Celery概述 关于celery的定义,首先来看官方网站: Celery(芹菜) 是一个简单.灵活且可靠的,处理大量消息的分布式系统,并且提供维护这样一个系统的必需工具. 简单来看,是一个基于pyt ...
- GOLANG编译安装
GO这个编译器搞的比较混乱,GO本身是汇编+C开发出来的,后来因为觉得自己牛逼,然后用GO语言又写了一次编译器,所以中途抛弃了C,不过这种做法好与不好很难说,go真的这么有自信用自己语言写自己的编译器 ...