09 2020 档案
摘要:package main import ( "encoding/json" "github.com/Unknwon/goconfig" "gopkg.in/gomail.v2" "log" "net/http" "net/url" "regexp" ) // 一些必须的配置 type Config
阅读全文
摘要:Mybatis 连表查询 准备 创建数据表 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- -- Table structure for student -- CREATE TABLE `student` ( `id` int(255) NOT N
阅读全文
摘要:注解开发 import com.example.pojo.User; import org.apache.ibatis.annotations.Select; public interface UserDao { @Select("select * from mybatis.user where i
阅读全文
摘要:Mybatis分页 通常的xml配置写法 List<User> getUserListPaged(Map<String, Integer> map); <select id="getUserListPaged" resultType="com.example.pojo.User" parameter
阅读全文
摘要:Mybatis日志 日志工厂 mybatis里面内置了下列日志 SLF4J LOG4J LOG4J2 JDK_LOGGING COMMONS_LOGGING STDOUT_LOGGING NO_LOGGING 在mybatis中具体使用哪一个日志实现,由设置决定 <?xml version="1.0
阅读全文
摘要:解决Mybaits数据库字段和属性名不一致的问题 表结构 + + + + + + + | Field | Type | Null | Key | Default | Extra | + + + + + + + | id | int(8) | NO | PRI | NULL | | | name |
阅读全文
摘要:Mybatis扩展 Map 使用map可以定制化sql的操作 实体类方法 void createUserByMap(HashMap<String, Object> map); 配置文件 <insert id="createUserByMap" parameterType="map"> insert
阅读全文
摘要:Mybatis入门 搭建环境 创建数据库 /* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 50716 Source Host :
阅读全文
摘要:java注解 定义:注解,也叫元数据。一种代码级别的说明。它是jdk1.5后引入的一个特性,与类、接口、枚举是在同一个层次。它可以声明在包、类、字段、方法、局部变量、方法参数等的前面,用来对这些元素进行说明,注释。 作用分类: 编写文档:通过代码里标识的元数据生成文档【生成文档doc】 代码分析:通
阅读全文
摘要:java反射 获取Class对象的方式 Class.forName("全类名"): 将字节码文件加载进内存,返回class对象 多用于配置文件,将类名定义在配置文件中,读取文件加载类 类名.class:通过类名的class属性来获取 多用于参数的传递 对象.getClass(): 通过对象的getC
阅读全文