2017.06.15
来源:互联网 发布:免费记忆力训练软件 编辑:程序博客网 时间:2024/05/21 10:31
mybatis:
http://www.cnblogs.com/xdp-gacl/category/655890.html
1.basic CRUD
create database
congif.xml to config datasources,
create entity refer to tables
mapping.xml to define sql
add mapping.xml to config.xml
load config.xml in java to call sql in mapping.xml
2.deal clash between cloumn and attribute
2.1.use alias replace cloumn on table by object's attribute
2.2.use <resultMap> to rename
3.mybatis Related inquiries
3.1.one to one
table:
one table keep fk refer to another table.
object:
the table who keep a foriegn key that the object is keep an object who containt the fk.
select result is use association to mapping columns'value to the object who the fk refer to own attribute.
3.2.one to many
table:
one do not change anything.
many keep a foreign key refer to one's id
object:
one is keep a list that containted object like many.
many does not keep foreign key's attribute in class.
select result:
use <collection> to mapping select result to list.
4.mybatis redis:
first cache:default open by session
second cache:sessionFactory cache.
Hibernate:cfg.xml need to load by ourself in code but struts and spring will config in web.xml
http://www.cnblogs.com/zhengcheng/p/5014246.html
1.basic:main file:hibernate.cfg.xml,student.hbm.xml
Configuration cf = new Configuration().configure();//create configuration
SessionFactory sf= cf.buildSessionFactory();//create SessionFactory
Session session = sf.openSession();//create session
public List<Student> qureyAll() {
String hql = "from student";
Query query = session.createQuery(hql);//don't begin transation
list = query.list();
}
public Student queryOne(String stuNo){
stu = session.load(Student.class,stuNo);
}
public void add(Student stu) {//add,update,delete need transation
Transation tx;
try{
tx = session.beginTransation();
session.save(stu);
tx.commit();
}catch(Exception e){
tx.rollback();
}finally{
session.close();
}
}
public void update(String stuNo,Student newStu){
tx = session.beginTransation();
Student stu = session.load(Student.class,stuNo);//first to find the object by id
stu.setName(newStu.getName());//change value for attributes
...
session.save(stu);//save
tx.commit();//commit or rollback
}
public void delete(String stuNo){
tx = session.beginTransation();
stu = session.load(Student.class,stuNo);
session.delete(stu);
tx.commit();
}
springMVC:
1.basic demo
1.1.create springmvc.xml:scan controller class under backage.
1.2.add servlet and servlet mapping to web.xml to interceptor request.
1.3.create controller class use @Controller and @RequestMapping tab and return modelAndView.
2.springmvc's annotates
@RequestMapping
@Controller
@PathVariable:receive data from url like http://localhost:8080/springmvc/hello/1
the class annotate like @RequestMapping("/hello/{id}"),and formal param annotate like @PathVariable(value="id") String id
@RequestParam
receive data like http://localhost:8080/springmvc/hello?id=1 that containt key and value mapping.
Linux:
1.ls -al / ll /
2.cd ~/ cd ../ ~:show current user's load
3.pwd
4.mkdir -pv /abc/123.txt p:creat parent dir if not exit./v:show detail
5.rmdir
6.cat install.log
more /root/install.log
7.less -mN /root/install.log N:show line number
8.cp -r /root/install.log /root/temp.log
9.mv -f /root/temp /root/install.log f:force to corver the old file
10.rm /root/install.log rm a file
rm -rf /root force to rm a dir by r
11.find /root/ -name 'test*'
12.vi install.log
i to input and exit to out,:wq is to exit vi
13.grep -i context /root/install.log/ seach containt "context" content in install.log.
cat /root/install/log | grep -i control filter that containt "control" base on out of cat install.log
SYS.ORDER
14.ps aux | grep -i ping show current thread's msg and filter that containt "ping" String.
ps -ef | grep -i ping i:ignore-case
15.kill -l show all running programming
kill -9 pid kill the 9 program
16.ifconfig equal win's ipconfig
17.ping 192.168.0.1
18.tar -zcvf /root/itheima.tar /root/itheima/ create
rm -rf /root/ithrima/ romove the dir first then to extract
ll | grep -i itheima query by filter
tar -zxvf /root/ithemia.tar extract
19.reboot restart
halt colse the power
20.chmod u-rwx /root/install.log cancle the all the power who's the user of this file.
chmod g-rwx /root/install.log
0
a
chmod 777 /root/install.log
mysql:
http://www.cnblogs.com/whgk/p/6149009.html
transaction
spring:
aop:
1.impl
http://www.cnblogs.com/xdp-gacl/category/655890.html
1.basic CRUD
create database
congif.xml to config datasources,
create entity refer to tables
mapping.xml to define sql
add mapping.xml to config.xml
load config.xml in java to call sql in mapping.xml
2.deal clash between cloumn and attribute
2.1.use alias replace cloumn on table by object's attribute
2.2.use <resultMap> to rename
3.mybatis Related inquiries
3.1.one to one
table:
one table keep fk refer to another table.
object:
the table who keep a foriegn key that the object is keep an object who containt the fk.
select result is use association to mapping columns'value to the object who the fk refer to own attribute.
3.2.one to many
table:
one do not change anything.
many keep a foreign key refer to one's id
object:
one is keep a list that containted object like many.
many does not keep foreign key's attribute in class.
select result:
use <collection> to mapping select result to list.
4.mybatis redis:
first cache:default open by session
second cache:sessionFactory cache.
Hibernate:cfg.xml need to load by ourself in code but struts and spring will config in web.xml
http://www.cnblogs.com/zhengcheng/p/5014246.html
1.basic:main file:hibernate.cfg.xml,student.hbm.xml
Configuration cf = new Configuration().configure();//create configuration
SessionFactory sf= cf.buildSessionFactory();//create SessionFactory
Session session = sf.openSession();//create session
public List<Student> qureyAll() {
String hql = "from student";
Query query = session.createQuery(hql);//don't begin transation
list = query.list();
}
public Student queryOne(String stuNo){
stu = session.load(Student.class,stuNo);
}
public void add(Student stu) {//add,update,delete need transation
Transation tx;
try{
tx = session.beginTransation();
session.save(stu);
tx.commit();
}catch(Exception e){
tx.rollback();
}finally{
session.close();
}
}
public void update(String stuNo,Student newStu){
tx = session.beginTransation();
Student stu = session.load(Student.class,stuNo);//first to find the object by id
stu.setName(newStu.getName());//change value for attributes
...
session.save(stu);//save
tx.commit();//commit or rollback
}
public void delete(String stuNo){
tx = session.beginTransation();
stu = session.load(Student.class,stuNo);
session.delete(stu);
tx.commit();
}
springMVC:
1.basic demo
1.1.create springmvc.xml:scan controller class under backage.
1.2.add servlet and servlet mapping to web.xml to interceptor request.
1.3.create controller class use @Controller and @RequestMapping tab and return modelAndView.
2.springmvc's annotates
@RequestMapping
@Controller
@PathVariable:receive data from url like http://localhost:8080/springmvc/hello/1
the class annotate like @RequestMapping("/hello/{id}"),and formal param annotate like @PathVariable(value="id") String id
@RequestParam
receive data like http://localhost:8080/springmvc/hello?id=1 that containt key and value mapping.
Linux:
1.ls -al / ll /
2.cd ~/ cd ../ ~:show current user's load
3.pwd
4.mkdir -pv /abc/123.txt p:creat parent dir if not exit./v:show detail
5.rmdir
6.cat install.log
more /root/install.log
7.less -mN /root/install.log N:show line number
8.cp -r /root/install.log /root/temp.log
9.mv -f /root/temp /root/install.log f:force to corver the old file
10.rm /root/install.log rm a file
rm -rf /root force to rm a dir by r
11.find /root/ -name 'test*'
12.vi install.log
i to input and exit to out,:wq is to exit vi
13.grep -i context /root/install.log/ seach containt "context" content in install.log.
cat /root/install/log | grep -i control filter that containt "control" base on out of cat install.log
SYS.ORDER
14.ps aux | grep -i ping show current thread's msg and filter that containt "ping" String.
ps -ef | grep -i ping i:ignore-case
15.kill -l show all running programming
kill -9 pid kill the 9 program
16.ifconfig equal win's ipconfig
17.ping 192.168.0.1
18.tar -zcvf /root/itheima.tar /root/itheima/ create
rm -rf /root/ithrima/ romove the dir first then to extract
ll | grep -i itheima query by filter
tar -zxvf /root/ithemia.tar extract
19.reboot restart
halt colse the power
20.chmod u-rwx /root/install.log cancle the all the power who's the user of this file.
chmod g-rwx /root/install.log
0
a
chmod 777 /root/install.log
mysql:
http://www.cnblogs.com/whgk/p/6149009.html
transaction
spring:
aop:
1.impl
阅读全文
0 0
- 2017.06.15
- ArchLinux安装图文教程(2017.06.15)
- ArchLinux安装图文教程(2017.06.15)
- 2017.06.15--spark中cache和persist的区别
- 2017.06.15-2016.06.18回顾 loc/iloc/ix dataframe相关 oracle无自增去重 correl
- 2017.06.08
- 2017.06.12
- 2017.06.14
- 2017.06.17
- 2017.06.20
- 2017.06.01回顾
- 人工智能(2017.06.02)
- 2017.06.07回顾 requests
- 2017.06.06学习总结
- 2017.06.08学习总结
- spark-2017.06.08
- 2017.06.19 学习总结
- 2017.06.19回顾
- 将博客搬至CSDN
- [置顶][原创]差分放大器阻抗匹配计算+阻抗计算小工具
- VR开发中,一个游戏对象绕着某目标旋转
- web界面测试用例(shelley_shu)
- C#的接口实现的依赖倒置、控制反转、依赖注入
- 2017.06.15
- 拉格朗日乘子&库恩塔克条件
- 【C++学习笔记】vector内元素含有动态内存问题
- VS2012使用 MSDN教程
- PHP面向对象编程:对父类方法进行扩展二
- [nginx] 在 Linux 服务器上部署 nginx 之后不能访问
- 非阻塞同步机制与CAS操作
- 【电脑硬件】如何选购内存条
- 说说 Java I/O 系统之 File 类