SpingBoot myBatis neo4j整合项目案例
此项目为spring boot - myBatis - neo4j数据库整合项目。
有增删改查(节点关系)、动态分页条件排序等一些示例。
git下载地址:git clone https://github.com/wsm1217395196/my-project-demo.git 项目名:springboot-mybatis-neo4j
运行此项目前请先到http://localhost:7474/browser/运行cql(确定安装了neo4j数据库)
create (u:user{name:'wsm',sex:'男',age:23}) - [l:like] -> (y:user{name:'yy',sex:'女',age:21})
pom文件依赖
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>springboot-neo4j-mybatis<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>springboot-neo4j-mybatis<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>1.0-SNAPSHOT<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"><<span class="hljs-name">dependencies</span>></span>
<span class="hljs-comment"><!--spring boot--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.springframework.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>spring-boot-starter-web<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>2.1.2.RELEASE<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.springframework.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>spring-boot-starter-test<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">scope</span>></span>test<span class="hljs-tag"></<span class="hljs-name">scope</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>2.1.2.RELEASE<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-comment"><!--org.json--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.json<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>json<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>20180813<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-comment"><!--neo4j-jdbc-driver--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.neo4j<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>neo4j-jdbc-driver<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>3.4.0<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-comment"><!--mybatis-spring-boot--></span>
<span class="hljs-tag"><<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.mybatis.spring.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>mybatis-spring-boot-starter<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">version</span>></span>2.0.1<span class="hljs-tag"></<span class="hljs-name">version</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependency</span>></span>
<span class="hljs-tag"></<span class="hljs-name">dependencies</span>></span>
<span class="hljs-tag"><<span class="hljs-name">build</span>></span>
<span class="hljs-tag"><<span class="hljs-name">plugins</span>></span>
<span class="hljs-tag"><<span class="hljs-name">plugin</span>></span>
<span class="hljs-tag"><<span class="hljs-name">groupId</span>></span>org.springframework.boot<span class="hljs-tag"></<span class="hljs-name">groupId</span>></span>
<span class="hljs-tag"><<span class="hljs-name">artifactId</span>></span>spring-boot-maven-plugin<span class="hljs-tag"></<span class="hljs-name">artifactId</span>></span>
<span class="hljs-tag"></<span class="hljs-name">plugin</span>></span>
<span class="hljs-tag"></<span class="hljs-name">plugins</span>></span>
<span class="hljs-tag"></<span class="hljs-name">build</span>></span>
</project>
application.yml
#端口号
server:
port: 8018
spring:
application:
name: springboot-mybatis-neo4j #服务名
datasource:
driver-class-name: org.neo4j.jdbc.http.HttpDriver
name: neo4j
password: root
url: jdbc:neo4j:http://localhost:7474
mybatis:
mapper-locations: classpath:mapper/*.xml
UserMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org/DTD Mapper 3.0" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.study.mapper.UserMapper">
<span class="hljs-comment"><!-- 自定义结果集--></span>
<span class="hljs-tag"><<span class="hljs-name">resultMap</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"userMap"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"com.study.model.UserModel"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">id</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"id"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"name"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"name"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"age"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"age"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"sex"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"sex"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">collection</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"userModels"</span> <span class="hljs-attr">ofType</span>=<span class="hljs-string">"com.study.model.UserModel"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">id</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"id"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"id1"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"name"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"name1"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"age"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"age1"</span>/></span>
<span class="hljs-tag"><<span class="hljs-name">result</span> <span class="hljs-attr">property</span>=<span class="hljs-string">"sex"</span> <span class="hljs-attr">column</span>=<span class="hljs-string">"sex1"</span>/></span>
<span class="hljs-tag"></<span class="hljs-name">collection</span>></span>
<span class="hljs-tag"></<span class="hljs-name">resultMap</span>></span>
<span class="hljs-comment"><!--这里CQL语句返回的字段名必须与上面定义的结果集的字段名一致,若不一致需要重命名,否则会报空指针异常 --></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getPage"</span> <span class="hljs-attr">resultMap</span>=<span class="hljs-string">"userMap"</span>></span>
match (u:user)
<span class="hljs-tag"><<span class="hljs-name">where</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"name != null and name != ''"</span>></span>
u.name =~ #{name}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"sex != null and sex != ''"</span>></span>
and u.sex = #{sex}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"></<span class="hljs-name">where</span>></span>
return
id(u) as id,u.name as name,u.age as age,u.sex as sex
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"sort != null and sort != ''"</span>></span>
order by ${sort}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"pageStart >= 0 and pageSize > 0"</span>></span>
skip #{pageStart} limit #{pageSize}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getPageTotal"</span> <span class="hljs-attr">resultType</span>=<span class="hljs-string">"int"</span>></span>
match (u:user)
<span class="hljs-tag"><<span class="hljs-name">where</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"name != null and name != ''"</span>></span>
u.name =~ #{name}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"><<span class="hljs-name">if</span> <span class="hljs-attr">test</span>=<span class="hljs-string">"sex != null and sex != ''"</span>></span>
and u.sex = #{sex}
<span class="hljs-tag"></<span class="hljs-name">if</span>></span>
<span class="hljs-tag"></<span class="hljs-name">where</span>></span>
return count(*)
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getAll"</span> <span class="hljs-attr">resultMap</span>=<span class="hljs-string">"userMap"</span>></span>
match
(u:user)
return
id(u) as id,u.name as name,u.age as age,u.sex as sex
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">select</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"getById"</span> <span class="hljs-attr">resultMap</span>=<span class="hljs-string">"userMap"</span>></span>
match
(u:user)- [l:like] -> (u1:user)
where
id(u) = #{id}
return
id(u) as id,u.name as name,u.age as age,u.sex as sex,
id(u1) as id1,u1.name as name1,u1.age as age1,u1.sex as sex1
<span class="hljs-tag"></<span class="hljs-name">select</span>></span>
<span class="hljs-tag"><<span class="hljs-name">insert</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"add"</span>></span>
create(u:user{name:#{model.name},age:#{model.age},sex:#{model.sex}})
<span class="hljs-tag"></<span class="hljs-name">insert</span>></span>
<span class="hljs-tag"><<span class="hljs-name">update</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"update"</span>></span>
match (u:user)
where id(u) = #{model.id}
set u.name = #{model.name},u.age = #{model.age},u.sex = #{model.sex}
<span class="hljs-tag"></<span class="hljs-name">update</span>></span>
<span class="hljs-tag"><<span class="hljs-name">delete</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"deleteById"</span>></span>
match (u:user) where id(u) = #{id} delete u
<span class="hljs-tag"></<span class="hljs-name">delete</span>></span>
</mapper>
UserMapper接口
package com.study.mapper;
import com.study.model.UserModel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface UserMapper {
<span class="hljs-built_in">List</span><UserModel> getPage(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"pageStart"</span>) <span class="hljs-built_in">int</span> pageStart, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"pageSize"</span>) <span class="hljs-built_in">int</span> pageSize, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"sort"</span>) <span class="hljs-built_in">String</span> sort, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"name"</span>) <span class="hljs-built_in">String</span> name, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"sex"</span>) <span class="hljs-built_in">String</span> sex);
<span class="hljs-built_in">int</span> getPageTotal(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"name"</span>) <span class="hljs-built_in">String</span> name, <span class="hljs-meta">@Param</span>(<span class="hljs-string">"sex"</span>) <span class="hljs-built_in">String</span> sex);
<span class="hljs-built_in">List</span><UserModel> getAll();
UserModel getById(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"id"</span>) Long id);
<span class="hljs-built_in">int</span> add(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"model"</span>) UserModel model);
<span class="hljs-built_in">int</span> update(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"model"</span>) UserModel model);
<span class="hljs-built_in">int</span> deleteById(<span class="hljs-meta">@Param</span>(<span class="hljs-string">"id"</span>) Long id);
}
userModel实体类
package com.study.model;
import java.util.List;
public class UserModel {
<span class="hljs-keyword">private</span> Long id;
<span class="hljs-keyword">private</span> String name;
<span class="hljs-keyword">private</span> Integer age;
<span class="hljs-keyword">private</span> String sex;
<span class="hljs-keyword">private</span> List<UserModel> userModels;
<span class="hljs-function"><span class="hljs-keyword">public</span> Long <span class="hljs-title">getId</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> id;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setId</span><span class="hljs-params">(Long id)</span> </span>{
<span class="hljs-keyword">this</span>.id = id;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getName</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> name;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setName</span><span class="hljs-params">(String name)</span> </span>{
<span class="hljs-keyword">this</span>.name = name;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> Integer <span class="hljs-title">getAge</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> age;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setAge</span><span class="hljs-params">(Integer age)</span> </span>{
<span class="hljs-keyword">this</span>.age = age;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getSex</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> sex;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setSex</span><span class="hljs-params">(String sex)</span> </span>{
<span class="hljs-keyword">this</span>.sex = sex;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> List<UserModel> <span class="hljs-title">getUserModels</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> userModels;
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setUserModels</span><span class="hljs-params">(List<UserModel> userModels)</span> </span>{
<span class="hljs-keyword">this</span>.userModels = userModels;
}
}
UserController控制器
package com.study.controller;
import com.study.mapper.UserMapper;
import com.study.model.UserModel;
import com.study.result.PageParam;
import com.study.result.PageResult;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/user")
public class UserController {
<span class="hljs-meta">@Autowired</span>
<span class="hljs-keyword">private</span> UserMapper userMapper;
<span class="hljs-comment">/**
* 分页条件查询
* 参数例:{"pageIndex":1,"pageSize":2,"sort":"u.sex desc","condition":"{'name':'','sex':'男'}"}
*
* <span class="hljs-doctag">@param</span> pageParam
* <span class="hljs-doctag">@return</span>
*/</span>
<span class="hljs-meta">@PostMapping</span>(<span class="hljs-string">"/getPage"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> PageResult <span class="hljs-title">getPage</span><span class="hljs-params">(@RequestBody PageParam pageParam)</span> </span>{
<span class="hljs-keyword">int</span> pageStart = pageParam.getPageStart();
<span class="hljs-keyword">int</span> pageIndex = pageParam.getPageIndex();
<span class="hljs-keyword">int</span> pageSize = pageParam.getPageSize();
String sort = pageParam.getSort();
JSONObject jsonObject = <span class="hljs-keyword">new</span> JSONObject(pageParam.getCondition());
String name = <span class="hljs-string">".*"</span> + jsonObject.getString(<span class="hljs-string">"name"</span>) + <span class="hljs-string">".*"</span>; <span class="hljs-comment">//模糊查询</span>
String sex = jsonObject.getString(<span class="hljs-string">"sex"</span>);
List<UserModel> models = userMapper.getPage(pageStart, pageSize, sort, name, sex);
<span class="hljs-keyword">int</span> total = userMapper.getPageTotal(name, sex);
PageResult pageResult = <span class="hljs-keyword">new</span> PageResult(pageIndex, pageSize, total, models);
<span class="hljs-keyword">return</span> pageResult;
}
<span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">"/getAll"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> List<UserModel> <span class="hljs-title">getAll</span><span class="hljs-params">()</span> </span>{
List<UserModel> models = userMapper.getAll();
<span class="hljs-keyword">return</span> models;
}
<span class="hljs-comment">/**
* 根据id查询(含节点关系)
*
* <span class="hljs-doctag">@param</span> id
* <span class="hljs-doctag">@return</span>
*/</span>
<span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">"/getById/{id}"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> UserModel <span class="hljs-title">getById</span><span class="hljs-params">(@PathVariable Long id)</span> </span>{
UserModel model = userMapper.getById(id);
<span class="hljs-keyword">return</span> model;
}
<span class="hljs-meta">@PostMapping</span>(<span class="hljs-string">"/add"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">add</span><span class="hljs-params">(@RequestBody UserModel model)</span> </span>{
<span class="hljs-keyword">int</span> i = userMapper.add(model);
<span class="hljs-keyword">return</span> i;
}
<span class="hljs-meta">@PostMapping</span>(<span class="hljs-string">"/update"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">update</span><span class="hljs-params">(@RequestBody UserModel model)</span> </span>{
<span class="hljs-keyword">int</span> i = userMapper.update(model);
<span class="hljs-keyword">return</span> i;
}
<span class="hljs-meta">@DeleteMapping</span>(<span class="hljs-string">"/deleteById/{id}"</span>)
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">deleteById</span><span class="hljs-params">(@PathVariable Long id)</span> </span>{
<span class="hljs-keyword">int</span> i = userMapper.deleteById(id);
<span class="hljs-keyword">return</span> i;
}
}
要用分页条件查询请到git 上复制 PageResult,PageParam类。
最后在入口类记得加上扫描mapper接口@MapperScan(“com.study.mapper”)
原文地址:https://blog.csdn.net/WSM960921/article/details/95076242 </div>
SpingBoot myBatis neo4j整合项目案例的更多相关文章
- SSM(Spring,SpringMVC,Mybatis)框架整合项目
快速上手SSM(Spring,SpringMVC,Mybatis)框架整合项目 环境要求: IDEA MySQL 8.0.25 Tomcat 9 Maven 3.6 数据库环境: 创建一个存放书籍数据 ...
- Spring3 + Spring MVC+ Mybatis 3+Mysql 项目整合(注解及源码)
Spring3 + Spring MVC+ Mybatis 3+Mysql 项目整合(注解及源码) 备注: 之前在Spring3 + Spring MVC+ Mybatis 3+Mysql 项目整合中 ...
- Mybatis入门之MyBatis项目案例
一.项目案例演示 后台管理系统用户数据维护平台 所有用户数据查询 单个用户数据查询 用户数据修改(完善资料) 锁定用户账号 删除用户账号 彻底删除用户账号 二.数据库数据准备工作 数据库:mysql ...
- Mybatis、maven项目中整合log4j (17)
Mybatis.maven项目总整合log4j java 中Mybatis.maven项目总整合log4j 1.pom增加log4j包引用 2.添加 log4j.properties文件 # java ...
- Spring+SpringMVC+MyBatis+easyUI整合优化篇(二)Log4j讲解与整合
日常啰嗦 上一篇文章主要讲述了一下syso和Log间的一些区别与比较,重点是在项目的日志功能上,因此,承接前文<Spring+SpringMVC+MyBatis+easyUI整合优化篇(一)Sy ...
- Spring+SpringMVC+MyBatis+easyUI整合优化篇(十三)数据层优化-表规范、索引优化
本文提要 最近写的几篇文章都是关于数据层优化方面的,这几天也在想还有哪些地方可以优化改进,结合日志和项目代码发现,关于数据层的优化,还是有几个方面可以继续修改的,代码方面,整合了druid数据源也开启 ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(一)设计一套好的RESTful API
写在前面的话 看了一下博客目录,距离上次更新这个系列的博文已经有两个多月,并不是因为不想继续写博客,由于中间这段时间更新了几篇其他系列的文章就暂时停止了,如今已经讲述的差不多,也就继续抽时间更新< ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(六)一定要RESTful吗?
作者:13 GitHub:https://github.com/ZHENFENG13 版权声明:本文为原创文章,未经允许不得转载. 写在前面的话 这个问题看起来就显得有些萌,或者说类似的问题都有些不靠 ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(七)一次线上Mysql数据库崩溃事故的记录
作者:13 GitHub:https://github.com/ZHENFENG13 版权声明:本文为原创文章,未经允许不得转载. 文章简介 工作这几年,技术栈在不断更新,项目管理心得也增加了不少,写 ...
随机推荐
- ssh连接Ubuntu之access denied
解决方法是: 修改/etc/ssh/ssh_config文件, #PermitRootLogin prohibit-password改为PermitRootLogin yes 然后 PasswordA ...
- CAS去掉HTTPS认证
如何去掉HTTPS认证? 说明:默认情况下HTTP也是可以访问CAS SERVER的,但认证,登陆,退出等操作均没有任何的效果.所以必须作出下面的修改 1.进入WEB-INF\spring-confi ...
- HBase Ganglia
- 新增的Java MapReduce API
http://book.51cto.com/art/201106/269647.htm Hadoop的版本0.20.0包含有一个新的 Java MapReduce API,有时也称为"上下文 ...
- webpack 处理图片文件
1. 安装 file-loader html-loader npm install file-loader html-loader --save-dev 其中html-loader生效需配合 html ...
- Java SE、Java EE、Java ME三者的区别
1. Java SE(Java Platform,Standard Edition).Java SE 以前称为 J2SE.它允许开发和部署在桌面.服务器.嵌入式环境和实时环境中使用的 Java 应用程 ...
- 深入浅出 Java Concurrency (20): 并发容器 part 5 ConcurrentLinkedQueue[转]
ConcurrentLinkedQueue是Queue的一个线程安全实现.先来看一段文档说明. 一个基于链接节点的无界线程安全队列.此队列按照 FIFO(先进先出)原则对元素进行排序.队列的头部 是队 ...
- httpclient遇到java.net.URISyntaxException: Illegal character in scheme name at index 0:
正准备按照大佬的解决办法处理, 看会一条回复,说url有空格 检查了一下,还真是有空格 去除url中的空格,问题解除
- js中的自执行匿名函数 (function(){})()
JS函数有两种命名方式 1.声明式 声明式会导致函数提升,function会被解释器优先编译.即我们用声明式写函数,可以在任何区域声明,不会影响我们调用. function XXX(){} 2.函数表 ...
- Java程序员面试题收集(5)
Java基础方面: 1.作用域public,private,protected,以及不写时的区别 答:区别如下: 作用域 当前类 同一package 子孙类 其他package public √ √ ...