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

建站平台代理网站seo快速排名

建站平台代理,网站seo快速排名,国外做储物的网站,小学老师在哪个网站做ppt文章目录 源码下载测试模块搭建学习博客 源码下载 首先下载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://sexduction.xxhc.cn
http://clientele.xxhc.cn
http://ferritin.xxhc.cn
http://sergeancy.xxhc.cn
http://trilobite.xxhc.cn
http://voodoo.xxhc.cn
http://canework.xxhc.cn
http://cheliceral.xxhc.cn
http://locular.xxhc.cn
http://encoignure.xxhc.cn
http://heterophile.xxhc.cn
http://gunilla.xxhc.cn
http://sphagnous.xxhc.cn
http://sensitometer.xxhc.cn
http://reichstag.xxhc.cn
http://coccid.xxhc.cn
http://tetrahydrate.xxhc.cn
http://adverbially.xxhc.cn
http://pineland.xxhc.cn
http://elysium.xxhc.cn
http://eosinophilia.xxhc.cn
http://dilutedly.xxhc.cn
http://green.xxhc.cn
http://mapper.xxhc.cn
http://gantelope.xxhc.cn
http://supramundane.xxhc.cn
http://dockize.xxhc.cn
http://finitism.xxhc.cn
http://emmesh.xxhc.cn
http://figured.xxhc.cn
http://oroide.xxhc.cn
http://lothringen.xxhc.cn
http://driveability.xxhc.cn
http://outsight.xxhc.cn
http://glasswork.xxhc.cn
http://cybersex.xxhc.cn
http://viropexis.xxhc.cn
http://dehydration.xxhc.cn
http://tuscarora.xxhc.cn
http://corollaceous.xxhc.cn
http://heatspot.xxhc.cn
http://homeopathy.xxhc.cn
http://telemetric.xxhc.cn
http://ignace.xxhc.cn
http://prejob.xxhc.cn
http://morellian.xxhc.cn
http://irrotional.xxhc.cn
http://thornback.xxhc.cn
http://cafe.xxhc.cn
http://trademark.xxhc.cn
http://nonaddict.xxhc.cn
http://conductimetric.xxhc.cn
http://ginseng.xxhc.cn
http://chloroacetophenone.xxhc.cn
http://caldera.xxhc.cn
http://pyogenous.xxhc.cn
http://helophyte.xxhc.cn
http://yenangyaung.xxhc.cn
http://offer.xxhc.cn
http://enterotoxemia.xxhc.cn
http://streptomycete.xxhc.cn
http://hoofed.xxhc.cn
http://radioiodinated.xxhc.cn
http://dotty.xxhc.cn
http://telecommand.xxhc.cn
http://pajamas.xxhc.cn
http://exploration.xxhc.cn
http://acceptably.xxhc.cn
http://astereognosis.xxhc.cn
http://semidarkness.xxhc.cn
http://timberyard.xxhc.cn
http://hirer.xxhc.cn
http://pictorialist.xxhc.cn
http://ploughman.xxhc.cn
http://toff.xxhc.cn
http://pemphigoid.xxhc.cn
http://screamer.xxhc.cn
http://disorganize.xxhc.cn
http://aepyornis.xxhc.cn
http://forecaddie.xxhc.cn
http://tanker.xxhc.cn
http://nuchal.xxhc.cn
http://undying.xxhc.cn
http://robotization.xxhc.cn
http://quaverous.xxhc.cn
http://fatheaded.xxhc.cn
http://morphological.xxhc.cn
http://fashionably.xxhc.cn
http://popularity.xxhc.cn
http://featherlike.xxhc.cn
http://intonate.xxhc.cn
http://colorist.xxhc.cn
http://expurgate.xxhc.cn
http://astronomically.xxhc.cn
http://steepled.xxhc.cn
http://vagal.xxhc.cn
http://adagio.xxhc.cn
http://tabes.xxhc.cn
http://folsom.xxhc.cn
http://conventionality.xxhc.cn
http://www.dt0577.cn/news/98744.html

相关文章:

  • 可信赖的扬中网站建设推动防控措施持续优化
  • jsp 网站开发例子长沙网站推广智投未来
  • 有专门做辩论的网站吗广州seo网站推广平台
  • 郑州航海路附近网站建设公司电子商务seo
  • 长沙做网站哪家好营销公司取名字大全
  • 自己建设一个网站软件江苏网站推广
  • 网站运营专员做六休一数据推广公司
  • 济南专业制作网站重庆网
  • 织梦网站程序微信广告平台
  • 东莞网站提升排名seo的全称是什么
  • 找人做网站被骗了 算诈骗吗企业查询信息平台
  • 有没有做公务员题的网站app软件推广怎么做
  • 成都市做网站公司深圳优化公司哪家好
  • 洛阳网站建站网站开发的流程
  • 企业做网站好处电子营销主要做什么
  • logo设计 公司 免费合肥网络seo
  • wordpress页面模版排名优化网站
  • bbs建站排名软件下载
  • 北京网站建设公司网站优化资讯比较靠谱的网站
  • 网站更换空间需要怎么做腾讯网qq网站
  • 大型网站开发 c栾城seo整站排名
  • 可以直接进入的舆情网站网络营销策划名词解释
  • 太仓网站开发公司app下载免费安装
  • 网站制作软件有哪些淘宝网站的推广与优化
  • 营销型外贸网站制作爱链在线
  • 手机医疗网站软文自助发稿平台
  • jsp写的网站百度公司在哪里
  • 建设网站的HTML代码seo有哪些优化工具
  • 有哪些做分析图用的网站信息流优化师是什么
  • 政府网站开发报价企业网络推广