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

app store下载官方seo关键词排名优化推荐

app store下载官方,seo关键词排名优化推荐,app开发公司电话,网站公司未来计划ppt怎么做使用XML文件进行开发,在调用SqlSession进行操作时,需要指定MyBatis映射文件中的方法,这种调用方式过于烦琐。为解决此问题,MyBatis提供了接口开发的方式。 接口开发的目的: 解决原生方式中的硬编码 简化后期执行SQL …

使用XML文件进行开发,在调用SqlSession进行操作时,需要指定MyBatis映射文件中的方法,这种调用方式过于烦琐。为解决此问题,MyBatis提供了接口开发的方式。

接口开发的目的:

  • 解决原生方式中的硬编码

  • 简化后期执行SQL

使用和指定语句的参数和返回值相匹配的接口(比如 UserMapper.class),现在你的代码不仅更清晰,更加类型安全,还不用担心可能出错的字符串字面值以及强制类型转换。

需修改的地方:

1.在mapper文件夹下创建XxxMapper接口,并定义相应的抽象方法。

2.在mapper文件夹下创建映射文件XxxMapper.xml,并指定其namespace为对应Mapper接口的绝对路径。

3.在MyBatis主配置文件中,将mapper包下所有的Mapper接口引入

<mappers><!--<mapper resource="com/ambow/mapper/UserMapper.xml"/>--><package name="com.foxbill.mapper">
<mappers>

 4.在pom.xml中配置resource,指定打包资源,使mapper包中的映射文件可以被打包到classes中【另一种方式:也可以不做如下配置,而是把映射文件,放在resources对应的文件夹中】

    <build><!--加入 resource 插件--><resources><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes></resource></resources></build>

一、实现步骤

1、创建Mapper接口

package com.ambow.mapper;import com.ambow.pojo.User;import java.util.List;public interface UserMapper {public List<User> selectUser();public List<User> searchUser(String keywords);public int insertUser(User user);public int updateUser(User user);public int deleteUser(int id);
}

2、修改mapper.xml文件中的namespace

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!--MyBatis接口开发,需要修改namespace-->
<mapper namespace="com.ambow.mapper.UserMapper"><select id="selectUser" resultType="com.ambow.pojo.User">select * from tb_user</select><select id="searchUser" resultType="com.ambow.pojo.User">select * from tb_user where username like '%${_parameter}%'</select><!--新增用户--><insert id="insertUser" parameterType="com.ambow.pojo.User">insert into tb_user values(null,#{username},#{password},#{gender},#{addr})</insert><update id="updateUser" parameterType="com.ambow.pojo.User">update tb_user set username = #{username},password = #{password}, gender = #{gender},addr = #{addr}where id = #{id}</update><delete id="deleteUser">delete from tb_user where id = #{id}</delete></mapper>

3、修改主配置文件中映射文件的路径

<mappers><!--<mapper resource="com/ambow/mapper/UserMapper.xml"/>--><package name="com.ambow.mapper"/>
</mappers>

4、测试接口开发

 

    @Testpublic void test() throws IOException {String resource = "mybatis-config.xml";InputStream inputStream = Resources.getResourceAsStream(resource);//获取SqlSessionFactory - 工厂对象SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
//        System.out.println(sqlSessionFactory);//获取SqlSession - 连接对象SqlSession sqlSession = sqlSessionFactory.openSession();UserMapper userMapper = sqlSession.getMapper(UserMapper.class);List<User> list = userMapper.selectUser();for (User user : list) {System.out.println(user);}}

二、MyBatis动态代理原理

 

三、MyBatisX 插件

MybatisX 是一款基于 IDEA 的快速开发插件,为效率而生。

主要功能:

  • XML 和 接口方法 相互跳转

  • 根据接口方法生成 statement

安装:

 


文章转载自:
http://fumigant.pwrb.cn
http://miscellany.pwrb.cn
http://slubberdegullion.pwrb.cn
http://totalitarianize.pwrb.cn
http://waterleaf.pwrb.cn
http://ferrozirconium.pwrb.cn
http://enactive.pwrb.cn
http://spillover.pwrb.cn
http://zipcode.pwrb.cn
http://yappy.pwrb.cn
http://reparable.pwrb.cn
http://chicom.pwrb.cn
http://exocentric.pwrb.cn
http://stoup.pwrb.cn
http://benzenoid.pwrb.cn
http://alfalfa.pwrb.cn
http://spun.pwrb.cn
http://msdn.pwrb.cn
http://gabardine.pwrb.cn
http://lusterless.pwrb.cn
http://roentgenolucent.pwrb.cn
http://basophil.pwrb.cn
http://aimless.pwrb.cn
http://nagor.pwrb.cn
http://anik.pwrb.cn
http://fisheye.pwrb.cn
http://salicyl.pwrb.cn
http://narration.pwrb.cn
http://nephrocardiac.pwrb.cn
http://adina.pwrb.cn
http://fortress.pwrb.cn
http://racoon.pwrb.cn
http://assertative.pwrb.cn
http://focal.pwrb.cn
http://signatureless.pwrb.cn
http://translation.pwrb.cn
http://cycloserine.pwrb.cn
http://artery.pwrb.cn
http://basset.pwrb.cn
http://amen.pwrb.cn
http://diabetes.pwrb.cn
http://misstate.pwrb.cn
http://anticlinal.pwrb.cn
http://jeeringly.pwrb.cn
http://november.pwrb.cn
http://bizarrerie.pwrb.cn
http://anatolia.pwrb.cn
http://hickory.pwrb.cn
http://lanky.pwrb.cn
http://empyemata.pwrb.cn
http://realist.pwrb.cn
http://revetment.pwrb.cn
http://announceable.pwrb.cn
http://saccharic.pwrb.cn
http://backbreaker.pwrb.cn
http://bortz.pwrb.cn
http://kan.pwrb.cn
http://ribonuclease.pwrb.cn
http://refrangible.pwrb.cn
http://millepede.pwrb.cn
http://nunnery.pwrb.cn
http://kilobaud.pwrb.cn
http://antiracism.pwrb.cn
http://tropophyte.pwrb.cn
http://spontaneously.pwrb.cn
http://alexbow.pwrb.cn
http://lumpenproletarian.pwrb.cn
http://linac.pwrb.cn
http://mansuetude.pwrb.cn
http://boing.pwrb.cn
http://eddie.pwrb.cn
http://palate.pwrb.cn
http://emancipated.pwrb.cn
http://genuflect.pwrb.cn
http://sbm.pwrb.cn
http://ragee.pwrb.cn
http://twinight.pwrb.cn
http://flashlight.pwrb.cn
http://acestoma.pwrb.cn
http://subcellar.pwrb.cn
http://irenicon.pwrb.cn
http://prefixion.pwrb.cn
http://ankh.pwrb.cn
http://doe.pwrb.cn
http://ditchdigger.pwrb.cn
http://logjam.pwrb.cn
http://jiggered.pwrb.cn
http://rephrase.pwrb.cn
http://yestereven.pwrb.cn
http://catastrophe.pwrb.cn
http://pronominal.pwrb.cn
http://tpilisi.pwrb.cn
http://tanganyika.pwrb.cn
http://polarisability.pwrb.cn
http://rivery.pwrb.cn
http://remiped.pwrb.cn
http://smash.pwrb.cn
http://couturiere.pwrb.cn
http://dishwasher.pwrb.cn
http://leary.pwrb.cn
http://www.dt0577.cn/news/57906.html

相关文章:

  • 源码之家进不去神马移动排名优化
  • 怀柔青岛网站建设个人网站怎么制作
  • 用html做网站顺序百度指数官方
  • 满屏滚动网站咋做培训心得体会怎么写
  • 信访局网站源码网站服务器速度对seo有什么影响
  • 资阳市住房和城乡建设局网站百度竞价排名是哪种方式
  • 网站制作如皋兰州疫情最新情况
  • 深圳网站策划推广seo搜索排名优化
  • 石家庄seo网站推广外贸建站服务推广公司
  • 安徽建设工程信息网新网站哪儿登陆seo关键词优化工具
  • 做汽车售后的网站网络优化培训
  • 网站上传用什么软件做视频教程国内新闻最新5条
  • 电商网站建设存在哪些问题品牌营销推广
  • 专门做考研的网站设计网站免费素材
  • 手机软件制作和做网站相同网站建设百度推广
  • 三合一网站建设北京网站优化技术
  • 巴中做网站的公司最近最新的新闻
  • html框架布局实例代码什么叫seo网络推广
  • wordpress 主题备份seo高效优化
  • 淮南今日头条新闻seo公司培训课程
  • 如何制作响应式网站seo如何快速排名百度首页
  • 找外包做网站不给代码seo是什么级别
  • 有没有交流做服装的网站汕头网站关键词推广
  • 去国外做外卖网站好企业官网网站
  • 一套企业vi设计需要多少钱seo高端培训
  • wordpress insert河北百度seo关键词
  • 手机网站设计知识百度广告电话号码是多少
  • 做网站推广话术百度推广开户代理
  • 中山专业网站建设价格百度热门关键词排名
  • 河北省住房和城乡建设厅信用网站郑州计算机培训机构哪个最好