当前位置: 首页 > news >正文

网站特效js代码下载关键词推广软件

网站特效js代码,下载关键词推广软件,营销型网站建设式球磨机,浙江瑞通建设集团网站文章目录 源码下载测试模块搭建学习博客 源码下载 首先下载mybatis-parent的源码:gitee地址 > https://gitee.com/callback_lab/mybatis-parent.git 然后下载mybatis的源码:gitee地址 > https://gitee.com/callback_lab/mybatis-src.git 带中文…

文章目录

  • 源码下载
  • 测试模块搭建
    • 学习博客


源码下载

首先下载mybatis-parent的源码:gitee地址 => https://gitee.com/callback_lab/mybatis-parent.git

然后下载mybatis的源码:gitee地址 => https://gitee.com/callback_lab/mybatis-src.git

带中文注释的三方源码


以下包需要注释,否则会报错 :

org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### Cause: java.lang.IllegalStateException: Cannot enable lazy loading because Javassist is not available. Add Javassist to your classpath.
    <dependency><groupId>ognl</groupId><artifactId>ognl</artifactId><version>3.2.20</version>
<!--      <scope>compile</scope>-->
<!--      <optional>true</optional>--></dependency><dependency><groupId>org.javassist</groupId><artifactId>javassist</artifactId><version>3.27.0-GA</version>
<!--      <scope>compile</scope>-->
<!--      <optional>true</optional>--></dependency>

将mybatis-parent与mybatis导入idea同一个project下。

测试模块搭建

新建一个测试模块,这里叫mybatis-gabriel

项目基础架构
在这里插入图片描述

实例原博客

pom :

  <dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version><scope>test</scope></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.3.0-SNAPSHOT</version></dependency></dependencies>

相关代码

主要测试入口代码

public class TestMain {public static void main(String[] args) {String resource = "mybatis-config.xml";InputStream inputStream = null;try {inputStream = Resources.getResourceAsStream(resource);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}SqlSessionFactory sqlSessionFactory = null;sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);SqlSession sqlSession = null;try {sqlSession = sqlSessionFactory.openSession();RoleMapper roleMapper = sqlSession.getMapper(RoleMapper.class);Role role = roleMapper.getRole(1L);System.out.println(role.getId() + ":" + role.getRoleName() + ":" + role.getNote());sqlSession.commit();} catch (Exception e) {// TODO Auto-generated catch blocksqlSession.rollback();e.printStackTrace();} finally {sqlSession.close();}}
}

po :

/** @author gethin* 角色的实体类*/
public class Role {private long id;private String roleName;private String note;public long getId() {return id;}public void setId(long id) {this.id = id;}public String getRoleName() {return roleName;}public void setRoleName(String roleName) {this.roleName = roleName;}public String getNote() {return note;}public void setNote(String note) {this.note = note;}
}

MyStringHandler :

@MappedTypes({String.class})
@MappedJdbcTypes(JdbcType.VARCHAR)
public class MyStringHandler implements TypeHandler<String> {Logger log= Logger.getLogger(MyStringHandler.class.getName());@Overridepublic String getResult(ResultSet rs, String colName) throws SQLException {log.info("使用我的TypeHandler,ResultSet列名获取字符串");return rs.getString(colName);}@Overridepublic String getResult(ResultSet rs, int index) throws SQLException {log.info("使用我的TypeHandler,ResultSet下标获取字符串");return rs.getString(index);}@Overridepublic String getResult(CallableStatement cs, int index) throws SQLException {log.info("使用我的TypeHandler,CallableStatement下标获取字符串");return cs.getString(index);}@Overridepublic void setParameter(PreparedStatement ps, int index, String value, JdbcType arg3) throws SQLException {log.info("使用我的TypeHandler");ps.setString(index, value);}}

mapper :

public interface RoleMapper {public Role getRole(Long id);public Role findRole(String roleName);public int deleteRole(Long id);public int insertRole(Role role);
}

RoleMapper.xml :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.mybatis.debug.mapper.RoleMapper"><resultMap type="org.mybatis.debug.po.Role" id="roleMap"><id column="id" property="id" javaType="long" jdbcType="BIGINT" /><result column="role_name" property="roleName" javaType="string"jdbcType="VARCHAR" /><result column="note" property="note"typeHandler="org.mybatis.debug.handle.MyStringHandler" /></resultMap><select id="getRole" parameterType="long" resultMap="roleMap">selectid,role_name as roleName,note from role where id=#{id}</select><select id="findRole" parameterType="long" resultMap="roleMap">selectid,role_name,note from role where role_name like CONCAT('%',#{roleNamejavaType=string,jdbcType=VARCHAR,typeHandler=com.gethin.handler.MyStringHandler},'%')</select><insert id="insertRole" parameterType="org.mybatis.debug.po.Role">insert intorole(role_name,note) value(#{roleName},#{note})</insert><delete id="deleteRole" parameterType="long">delete from role whereid=#{id}</delete>
</mapper>

sql :

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (`id` int(11) DEFAULT NULL,`role_name` varchar(255) DEFAULT NULL,`note` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', '管理员', '管理员');
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (`id` int(11) DEFAULT NULL,`role_id` int(11) DEFAULT NULL,`user_name` varchar(255) DEFAULT NULL,`user_note` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `user` VALUES ('1', '1','张三', '管理员张三');

学习博客

调试博客

http://www.hkea.cn/news/83548/

相关文章:

  • 运城市做网站英文seo外链
  • 江宁网站建设如何建立网上销售平台
  • 淄博企业网站建设有限公司搜索引擎关键词竞价排名
  • 网站的优点企业专业搜索引擎优化
  • 哪里有软件开发培训机构无锡seo培训
  • 网站怎么做反链seo是什么品牌
  • 技术型网站做哪一种好软文范例大全100
  • 百度搜索什么关键词能搜到网站seo高效优化
  • 网站搭建分站需要多少钱互联网营销策划
  • 音乐网站的音乐怎么做seo先上排名后收费
  • 清河做网站报价seo实战培训王乃用
  • wordpress 回收站在哪个文件夹营销方式和手段
  • 垂直型电商网站如何做快速排名软件哪个好
  • 做产品推广有网站比较好的免费自助建站平台
  • 番禺网站建设公司排名百度推广页面投放
  • 沈阳做微网站百度收录刷排名
  • 网站建设与管理技术发展seo是什么意思如何实现
  • 手机游戏开发制作公司最新seo视频教程
  • 网站优化过度被k长春seo排名公司
  • wordpress移除谷歌字体seo网站推广与优化方案
  • 十大景观设计公司排名seo权重查询
  • 水友做的yyf网站十大免费引流平台
  • 东莞公司网站制作百度识图网页版 在线
  • 企业级网站内容管理解决方案网站关键词快速排名服务
  • 影视采集网站怎么做收录关键词是网站seo的核心工作
  • 开发一个网站需要多少时间百度账号免费注册
  • 化妆品网站主页设计长沙关键词优化方法
  • 南阳建网站企业百度推广优化工具
  • 怎样把自己做的网页放在网站里如何做宣传推广营销
  • 七谷网络工作室重庆优化seo