同样老习惯,先上项目结构截图

首先 补充上篇文中缺失的 mysql demo 用的 小脚本

  1. drop database if exists mybatis;
  2.  
  3. CREATE DATABASE `mybatis` DEFAULT CHARACTER SET utf8 ;
  4.  
  5. use mybatis;
  6. /*
  7. SQLyog v10.2
  8. MySQL - 5.1.72-community : Database - mybatis
  9. *********************************************************************
  10. */
  11. /*Table structure for table `items` */
  12.  
  13. CREATE TABLE `items` (
  14. `id` int(11) NOT NULL AUTO_INCREMENT,
  15. `name` varchar(32) NOT NULL COMMENT '商品名称',
  16. `price` float(10,1) NOT NULL COMMENT '商品定价',
  17. `detail` text COMMENT '商品描述',
  18. `pic` varchar(64) DEFAULT NULL COMMENT '商品图片',
  19. `createtime` datetime NOT NULL COMMENT '生产日期',
  20. PRIMARY KEY (`id`)
  21. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  22.  
  23. /*Table structure for table `user` */
  24.  
  25. CREATE TABLE `user` (
  26. `id` int(11) NOT NULL AUTO_INCREMENT,
  27. `username` varchar(32) NOT NULL COMMENT '用户名称',
  28. `birthday` date DEFAULT NULL COMMENT '生日',
  29. `sex` char(1) DEFAULT NULL COMMENT '性别',
  30. `address` varchar(256) DEFAULT NULL COMMENT '地址',
  31. PRIMARY KEY (`id`)
  32. ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
  33.  
  34. /*Table structure for table `orders` */
  35.  
  36. CREATE TABLE `orders` (
  37. `id` int(11) NOT NULL AUTO_INCREMENT,
  38. `user_id` int(11) NOT NULL COMMENT '下单用户id',
  39. `number` varchar(32) NOT NULL COMMENT '订单号',
  40. `createtime` datetime NOT NULL COMMENT '创建订单时间',
  41. `note` varchar(100) DEFAULT NULL COMMENT '备注',
  42. PRIMARY KEY (`id`),
  43. KEY `FK_orders_1` (`user_id`),
  44. CONSTRAINT `FK_orders_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  45. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  46.  
  47. /*Table structure for table `orderdetail` */
  48.  
  49. CREATE TABLE `orderdetail` (
  50. `id` int(11) NOT NULL AUTO_INCREMENT,
  51. `orders_id` int(11) NOT NULL COMMENT '订单id',
  52. `items_id` int(11) NOT NULL COMMENT '商品id',
  53. `items_num` int(11) DEFAULT NULL COMMENT '商品购买数量',
  54. PRIMARY KEY (`id`),
  55. KEY `FK_orderdetail_1` (`orders_id`),
  56. KEY `FK_orderdetail_2` (`items_id`),
  57. CONSTRAINT `FK_orderdetail_1` FOREIGN KEY (`orders_id`) REFERENCES `orders` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  58. CONSTRAINT `FK_orderdetail_2` FOREIGN KEY (`items_id`) REFERENCES `items` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  59. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

mysql 数据库及表结构

  1. /*
  2. SQLyog v10.2
  3. MySQL - 5.1.72-community : Database - mybatis
  4. *********************************************************************
  5. */
  6. /*Data for the table `items` */
  7.  
  8. insert into `items`(`id`,`name`,`price`,`detail`,`pic`,`createtime`) values (1,'台式机',3000.0,'该电脑质量非常好!!!!',NULL,'2016-02-03 13:22:53'),(2,'笔记本',6000.0,'笔记本性能好,质量好!!!!!',NULL,'2015-02-09 13:22:57'),(3,'背包',200.0,'名牌背包,容量大质量好!!!!',NULL,'2016-02-06 13:23:02');
  9.  
  10. /*Data for the table `user` */
  11.  
  12. insert into `user`(`id`,`username`,`birthday`,`sex`,`address`) values (1,'王五',NULL,'',NULL),(10,'张三','2016-07-10','','北京市'),(16,'张小明',NULL,'','河南郑州'),(22,'陈小明',NULL,'','河南郑州'),(24,'张三丰',NULL,'','河南郑州'),(25,'陈小明',NULL,'','河南郑州'),(26,'王五',NULL,NULL,NULL);
  13.  
  14. /*Data for the table `orders` */
  15.  
  16. insert into `orders`(`id`,`user_id`,`number`,`createtime`,`note`) values (3,1,'','2016-02-04 13:22:35',NULL),(4,1,'','2016-02-03 13:22:41',NULL),(5,10,'','2016-02-12 16:13:23',NULL);
  17.  
  18. /*Data for the table `orderdetail` */
  19.  
  20. insert into `orderdetail`(`id`,`orders_id`,`items_id`,`items_num`) values (1,3,1,1),(2,3,2,3),(3,4,3,4),(4,4,2,3);

mysql 插入测试数据脚本

工程采用 maven 管理,pom.xml 内容如下

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6.  
  7. <groupId>com.ghc</groupId>
  8. <artifactId>mybatisdao</artifactId>
  9. <version>1.0-SNAPSHOT</version>
  10. <packaging>war</packaging>
  11.  
  12. <name>mybatisdao Maven Webapp</name>
  13. <!-- FIXME change it to the project's website -->
  14. <url>http://www.example.com</url>
  15.  
  16. <properties>
  17. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  18. <maven.compiler.source>1.7</maven.compiler.source>
  19. <maven.compiler.target>1.7</maven.compiler.target>
  20. </properties>
  21.  
  22. <dependencies>
  23. <!-- https://mvnrepository.com/artifact/junit/junit -->
  24. <dependency>
  25. <groupId>junit</groupId>
  26. <artifactId>junit</artifactId>
  27. <version>4.12</version>
  28. <scope>test</scope>
  29. </dependency>
  30.  
  31. <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
  32. <dependency>
  33. <groupId>org.mybatis</groupId>
  34. <artifactId>mybatis</artifactId>
  35. <version>3.4.6</version>
  36. </dependency>
  37.  
  38. <!-- https://mvnrepository.com/artifact/log4j/log4j -->
  39. <dependency>
  40. <groupId>log4j</groupId>
  41. <artifactId>log4j</artifactId>
  42. <version>1.2.17</version>
  43. </dependency>
  44.  
  45. <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
  46. <dependency>
  47. <groupId>mysql</groupId>
  48. <artifactId>mysql-connector-java</artifactId>
  49. <version>5.1.18</version>
  50. </dependency>
  51.  
  52. </dependencies>
  53.  
  54. <build>
  55. <finalName>mybatisdao</finalName>
  56. <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
  57. <plugins>
  58. <plugin>
  59. <artifactId>maven-clean-plugin</artifactId>
  60. <version>3.0.0</version>
  61. </plugin>
  62. <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
  63. <plugin>
  64. <artifactId>maven-resources-plugin</artifactId>
  65. <version>3.0.2</version>
  66. </plugin>
  67. <plugin>
  68. <artifactId>maven-compiler-plugin</artifactId>
  69. <version>3.7.0</version>
  70. </plugin>
  71. <plugin>
  72. <artifactId>maven-surefire-plugin</artifactId>
  73. <version>2.20.1</version>
  74. </plugin>
  75. <plugin>
  76. <artifactId>maven-war-plugin</artifactId>
  77. <version>3.2.0</version>
  78. </plugin>
  79. <plugin>
  80. <artifactId>maven-install-plugin</artifactId>
  81. <version>2.5.2</version>
  82. </plugin>
  83. <plugin>
  84. <artifactId>maven-deploy-plugin</artifactId>
  85. <version>2.8.2</version>
  86. </plugin>
  87. </plugins>
  88. </pluginManagement>
  89. </build>
  90. </project>

pom.xml

接下来就是 四个 配置文件了, 其中 db.properties 里的 key 到 SqlMappingConfig.xml 里就引用不到,这点作为初学者也觉得无奈,暂且就硬编码吧

  1. jdbc.driver=com.mysql.jdbc.Driver
  2. jdbc.url=jdbc:mysql://localhost:3306/mybatis?characterEncoding=UTF-8
  3. jdbc.username=root
  4. jdbc.password=Mede645

db.properties 引用不到显得可有可无

  1. log4j.rootLogger=DEBUG,A1
  2. log4j.logger.org.springframework=debug
  3. log4j.appender.A1=org.apache.log4j.ConsoleAppender
  4. log4j.appender.A1.layout=org.apache.log4j.PatternLayout
  5. log4j.appender.A1.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n

log4j.properties 不用重点关注

下面这个很重要很重要,是入口配置文件
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE configuration
  3. PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-config.dtd">
  5. <configuration>
  6.  
  7. <!-- 加载属性文件 -->
  8. <properties resource="db.properties">
  9. <!--properties中还可以配置一些属性名和属性值 -->
  10. <!-- <property name="jdbc.driver" value=""/> -->
  11. </properties>
  12.  
  13. <typeAliases>
  14.  
  15. <typeAlias type="com.ghc.pojo.User" alias="user" />
  16.  
  17. </typeAliases>
  18.  
  19. <!-- 和spring整合后 environments配置将废除 -->
  20. <environments default="development">
  21. <environment id="development">
  22. <!-- 使用jdbc事务管理,事务控制由mybatis -->
  23. <transactionManager type="JDBC" />
  24. <!-- 数据库连接池,由mybatis管理 -->
  25. <dataSource type="POOLED">
  26. <property name="driver" value="com.mysql.jdbc.Driver" />
  27. <property name="url" value="jdbc:mysql://localhost:3306/mybatis?characterEncoding=UTF-8" />
  28. <property name="username" value="root" />
  29. <property name="password" value="Mede645" />
  30. </dataSource>
  31. </environment>
  32. </environments>
  33.  
  34. <mappers>
  35. <mapper resource="User.xml"/>
  36. </mappers>
  37.  
  38. </configuration>

SqlMappingConfig.xml 很重要很重要

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5.  
  6. <mapper namespace="com.ghc.dao.UserDao">
  7. <select id="findUserById" parameterType="java.lang.Integer" resultType="user">
  8. SELECT * FROM user WHERE id =#{userid} <!--简单类型 随意取名-->
  9. </select>
  10.  
  11. </mapper>

User.xml 这个配置文件也比较重要

  1. <select id="findUserLike" parameterType="java.lang.String" resultType="user">
  2. SELECT * FROM user WHERE username LIKE '%${value}%'
  3. </select>
  4. <insert id="addUser" parameterType="user">
  5. INSERT INTO user(username,birthday,sex,address) values(#{userName},#{birthday},#{sex},#{address})
  6. </insert>
  7. <delete id="deleteUserById" parameterType="int">
  8. DELETE FROM user WHERE id=#{id}
  9. </delete>
  10. <update id="updateUserById" parameterType="user">
  11. UPDATE user set username=#{userName},birthday= #{birthday},sex=#{sex},address=#{address} WHERE id = #{id}
  12. </update>
  13.  
  14. 上面是新增的 部分,下面请拷贝如有需要
  15.  
  16. <?xml version="1.0" encoding="UTF-8" ?>
  17. <!DOCTYPE mapper
  18. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  19. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  20.  
  21. <mapper namespace="com.ghc.dao.UserDao">
  22. <select id="findUserById" parameterType="java.lang.Integer" resultType="user">
  23. SELECT * FROM user WHERE id =#{userid} <!--简单类型 随意取名-->
  24. </select>
  25.  
  26. <select id="findUserLike" parameterType="java.lang.String" resultType="user">
  27. SELECT * FROM user WHERE username LIKE '%${value}%'
  28. </select>
  29. <insert id="addUser" parameterType="user">
  30. INSERT INTO user(username,birthday,sex,address) values(#{userName},#{birthday},#{sex},#{address})
  31. </insert>
  32. <delete id="deleteUserById" parameterType="int">
  33. DELETE FROM user WHERE id=#{id}
  34. </delete>
  35. <update id="updateUserById" parameterType="user">
  36. UPDATE user set username=#{userName},birthday= #{birthday},sex=#{sex},address=#{address} WHERE id = #{id}
  37. </update>
  38. </mapper>

修改后的 User.xml

与持久层映射的 pojo 对象 , 就是 简单java 对象的意思,没事儿别整高大上,故作高深。。。。

  1. package com.ghc.pojo;
  2.  
  3. import java.util.Date;
  4.  
  5. public class User {
  6. private int id;
  7. private String userName;
  8. private Date birthday;
  9. private String sex;
  10. private String address;
  11.  
  12. public int getId() {
  13. return id;
  14. }
  15.  
  16. public void setId(int id) {
  17. this.id = id;
  18. }
  19.  
  20. public String getUserName() {
  21. return userName;
  22. }
  23.  
  24. public void setUserName(String userName) {
  25. this.userName = userName;
  26. }
  27.  
  28. public Date getBirthday() {
  29. return birthday;
  30. }
  31.  
  32. public void setBirthday(Date birthday) {
  33. this.birthday = birthday;
  34. }
  35.  
  36. public String getSex() {
  37. return sex;
  38. }
  39.  
  40. public void setSex(String sex) {
  41. this.sex = sex;
  42. }
  43.  
  44. public String getAddress() {
  45. return address;
  46. }
  47.  
  48. public void setAddress(String address) {
  49. this.address = address;
  50. }
  51. }

com.ghc.pojo.User

第一种方法采用 原始 dao 开发方法即先写 dao 接口,再写其实现类

  1. package com.ghc.dao;
  2. import com.ghc.pojo.User;
  3. public interface UserDao{
  4. public User findUserById(int id) throws Exception;
  5. }

com.ghc.dao.UserDao 接口

  1. package com.ghc.dao;
  2.  
  3. import com.ghc.pojo.User;
  4. import org.apache.ibatis.jdbc.SQL;
  5. import org.apache.ibatis.session.SqlSessionFactory;
  6.  
  7. import java.io.IOException;
  8.  
  9. public class UserDaoImp implements UserDao {
  10. // 由于没有整合,这里无法使用spring容器自动注入,手动采取构造函数注入
  11. // SqlSessionFactoryBuilder 看做工具类,而 SqlSessionFactor 做成单例
  12. //private SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();
  13. private SqlSessionFactory sqlSessionFactory;
  14. public UserDaoImp(SqlSessionFactory sqlSessionFactory){
  15. this.sqlSessionFactory = sqlSessionFactory;
  16. }
  17. @Override
  18. public User findUserById(int id) throws IOException {
  19. return sqlSessionFactory.openSession().selectOne("com.ghc.dao.UserDao.findUserById",id);
  20. }
  21. }

com.ghc.UserDaoImp 接口实现类

  1. package com.ghc.dao;
  2. import com.ghc.pojo.User;
  3.  
  4. import java.util.List;
  5.  
  6. public interface UserDao{
  7. User findUserById(int id) throws Exception;
  8. List<User> findUserLike(String userName) throws Exception;
  9. void addUser(User user) throws Exception;
  10. void deleteUserById(int id) throws Exception;
  11. void updateUserById(User user) throws Exception;
  12. }

添加新功能的dao层接口

  1. package com.ghc.dao;
  2.  
  3. import com.ghc.pojo.User;
  4. import org.apache.ibatis.jdbc.SQL;
  5. import org.apache.ibatis.session.SqlSession;
  6. import org.apache.ibatis.session.SqlSessionFactory;
  7.  
  8. import java.io.IOException;
  9. import java.util.List;
  10.  
  11. public class UserDaoImp implements UserDao {
  12. // 由于没有整合,这里无法使用spring容器自动注入,手动采取构造函数注入
  13. // SqlSessionFactoryBuilder 看做工具类,而 SqlSessionFactor 做成单例
  14. //private SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();
  15. private SqlSessionFactory sqlSessionFactory;
  16. public UserDaoImp(SqlSessionFactory sqlSessionFactory){
  17. this.sqlSessionFactory = sqlSessionFactory;
  18. }
  19. @Override
  20. public User findUserById(int id) throws IOException {
  21. return sqlSessionFactory.openSession().selectOne("com.ghc.dao.UserDao.findUserById",id);
  22. }
  23.  
  24. @Override
  25. public List<User> findUserLike(String userName) throws Exception {
  26. return sqlSessionFactory.openSession().selectList("com.ghc.dao.UserDao.findUserLike",userName);
  27. }
  28.  
  29. @Override
  30. public void addUser(User user) throws Exception {
  31. SqlSession sqlSession = sqlSessionFactory.openSession();
  32. sqlSession.insert("com.ghc.dao.UserDao.addUser",user);
  33. sqlSession.commit();
  34. }
  35.  
  36. @Override
  37. public void deleteUserById(int id) throws Exception {
  38. SqlSession sqlSession = sqlSessionFactory.openSession();
  39. sqlSession.delete("com.ghc.dao.UserDao.deleteUserById",id );
  40. sqlSession.commit();
  41. }
  42.  
  43. @Override
  44. public void updateUserById(User user) throws Exception {
  45. SqlSession sqlSession= sqlSessionFactory.openSession();
  46. sqlSession.update("com.ghc.dao.UserDao.updateUserById",user);
  47. sqlSession.commit();
  48. }
  49.  
  50. }

添加新功能后的dao层实现类

既然第一个 UserDao 开发好了,我们就可以直接拿来测试一波了

  1. import com.ghc.dao.UserDao;
  2. import com.ghc.dao.UserDaoImp;
  3. import com.ghc.pojo.User;
  4. import org.apache.ibatis.io.Resources;
  5. import org.apache.ibatis.session.SqlSessionFactory;
  6. import org.apache.ibatis.session.SqlSessionFactoryBuilder;
  7. import org.junit.Test;
  8.  
  9. public class UserDaoTest {
  10. @Test
  11. public void testUserDao() throws Exception{
  12. SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("SqlMappingConfig.xml"));
  13. UserDao userDao = new UserDaoImp(sqlSessionFactory);
  14. User user = userDao.findUserById(1);
  15. System.out.println(user.getUserName());
  16. }
  17. }

junit测试一波咯

  1. import com.ghc.dao.UserDao;
  2. import com.ghc.dao.UserDaoImp;
  3. import com.ghc.pojo.User;
  4. import org.apache.ibatis.io.Resources;
  5. import org.apache.ibatis.session.SqlSessionFactory;
  6. import org.apache.ibatis.session.SqlSessionFactoryBuilder;
  7. import org.junit.Test;
  8.  
  9. import java.util.List;
  10. import java.util.Date;
  11.  
  12. public class UserDaoTest {
  13. @Test
  14. public void testUserDao() throws Exception{
  15. SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("SqlMappingConfig.xml"));
  16. UserDao userDao = new UserDaoImp(sqlSessionFactory);
  17. User user = userDao.findUserById(1);
  18. System.out.println(user.getUserName());
  19. List<User> userList = userDao.findUserLike("小明");
  20. for(User u:userList){
  21. System.out.println(u.getUserName());
  22. }
  23.  
  24. User user1 = new User();
  25. user1.setUserName("孔方兄");
  26. user1.setSex("某");
  27. user1.setBirthday(new Date());
  28. user1.setAddress("麓谷");
  29. userDao.addUser(user1);
  30.  
  31. // userDao.deleteUserById(1); 因为主外键的问题所以暂注释掉
  32.  
  33. // update 方法
  34. User user2 = new User();
  35. user2.setId(43);
  36. user2.setUserName("黑钻石王老五");
  37. user2.setBirthday(new Date());
  38. user2.setSex("南");
  39. user2.setAddress("北京天安门");
  40. userDao.updateUserById(user2);
  41. }
  42. }

添加新功能后的测试文件

测试结果:

待续 第二种 只写接口方法。。。

mybatis dao 层开发简易版 非整合 spring的更多相关文章

  1. 基于Mybatis的Dao层开发

    转自:https://www.cnblogs.com/rodge-run/p/6528398.html 基于Mybatis的Dao层开发 SqlSessionFactoryBuilder用于创建 Sq ...

  2. SSM框架之Mybatis(3)dao层开发

    Mybatis(3)dao层开发 以实现类完成CRUD操作 1.持久层dao层接口的书写 src\main\java\dao\IUserDao.java package dao; import dom ...

  3. Spring Boot 2.X(二):集成 MyBatis 数据层开发

    MyBatis 简介 概述 MyBatis 是一款优秀的持久层框架,支持定制化 SQL.存储过程以及高级映射.它采用面向对象编程的方式对数据库进行 CRUD 的操作,使程序中对关系数据库的操作更方便简 ...

  4. MyBatis dao层 方法传参

    MyBatis dao层 方法传参有三种方法. 1. 以下标的方法获取参数. <update id="insertSuccessKilled">       INSER ...

  5. C#调用OpenCV开发简易版美图工具

    前言 在C#调用OpenCV其实非常简单,因为C#中有很多OPenCV的开源类库. 本文主要介绍在WPF项目中使用OpenCVSharp3-AnyCPU开源类库处理图片,下面我们先来做开发前的准备工作 ...

  6. MyBatis Dao层的编写

    传统的dao层编写 以前编写dao层,先新建一个包com.chy.dao,再写接口StudentDao: public interface StudentDao { public void inser ...

  7. (转)MyBatis框架的学习(三)——Dao层开发方法

    http://blog.csdn.net/yerenyuan_pku/article/details/71700957 使用MyBatis开发Dao层,通常有两个方法,即原始Dao开发方法和Mappe ...

  8. MyBatis开发Dao层的两种方式(原始Dao层开发)

    本文将介绍使用框架mybatis开发原始Dao层来对一个对数据库进行增删改查的案例. Mapper动态代理开发Dao层请阅读我的下一篇博客:MyBatis开发Dao层的两种方式(Mapper动态代理方 ...

  9. 02.MyBatis在DAO层开发使用的Mapper动态代理方式

    在实际开发中,Mybatis作用于DAO层,那么Service层该如何调用Mybatis Mybatis鼓励使用Mapper动态代理的方式 Mapper接口开发方法只需要程序员编写Mapper接口(相 ...

随机推荐

  1. Asp.Net_Ajax调用WebService返回Json前台获取循环解析

    利用JQuery的$.ajax()可以很方便的调用 asp.net的后台方法.但往往从后台返回的json字符串不能够正确解析,究其原因,是因为没有对返回的json数据做进一步的加工.其实,这里只需 要 ...

  2. docker之compose 编排项目

    一.docker-compose 的介绍 docker-compose是一种容器编排工具,可以将多个docker容器关联部署.通过yaml文件,可以描述应用的架构,如使用什么镜像.数据卷.网络.绑定服 ...

  3. live555学习(一)通读Makefile编译live555

    live555学习(一)通读Makefile编译live555 live555 编译live555 学习开源 live555学习(一)通读Makefile编译live555 前言 live555简介 ...

  4. Git多人协作工作流程

    前言 之前一直把Git当做个人版本控制的工具使用,现在由于工作需要,需要多人协作维护文档,所以去简单了解了下Git多人协作的工作流程,发现还真的很多讲解的,而且大神也已经讲解得很清楚了,这里就做一个简 ...

  5. 微软职位内部推荐-Senior Software Development Engineer_Commerce

    微软近期Open的职位: Are you looking for a high impact project that involves processing of billions of dolla ...

  6. linq to sql中的自动缓存(对象跟踪)

    linq to sql中,对于同一个DataContext上下文环境,根据表主键选择记录时(当然这里所指的“记录”会自动转成“对象”),如果该记录已经被select过,默认情况下会被自动缓存下来,下次 ...

  7. CodeM Qualifying Match Q5

    问题描述: 给定两个整数 l 和 r ,对于所有满足1 ≤ l ≤ x ≤ r ≤ 10^9 的 x ,把 x 的所有约数全部写下来. 对于每个写下来的数,只保留最高位的那个数码.求1-9每个数码出现 ...

  8. PAT 1044 火星数字

    https://pintia.cn/problem-sets/994805260223102976/problems/994805279328157696 火星人是以13进制计数的: 地球人的0被火星 ...

  9. How to delete deployed process definition in activiti?

    https://community.alfresco.com/thread/219767-how-to-delete-deployed-process

  10. [转载]Docker 完全指南

    Docker 完全指南 原作者地址: https://wdxtub.com/2017/05/01/docker-guide/  发表于 2017-05-01 |  更新于 2017-08-03 |   ...