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

rest api 做网站wordpress投稿收费吗

rest api 做网站,wordpress投稿收费吗,路由器当服务器做网站,湖北洈水水利水电建设公司网站自定义映射resultMap 自定义映射resultMap 自定义映射resultMapresultMap处理字段和属性的映射关系字段名和属性名不一致的情况#xff0c;如何处理映射关系?1、为查询的字段设置别名#xff0c;和属性名保持一致2、核心配置文件(mybatis-config.xml)中设置一个全局配置3、使…自定义映射resultMap 自定义映射resultMap 自定义映射resultMapresultMap处理字段和属性的映射关系字段名和属性名不一致的情况如何处理映射关系?1、为查询的字段设置别名和属性名保持一致2、核心配置文件(mybatis-config.xml)中设置一个全局配置3、使用resultMap自定义映射处理1处理多对一的映射关系①级联方式处理②association③分步查询 2处理一对多的映射关系 resultMap处理字段和属性的映射关系 字段名和属性名不一致的情况如何处理映射关系? 属性名 字段名 1、为查询的字段设置别名和属性名保持一致 select idgetEmpByEmpId resultTypeEmpselect emp_id empId,emp_name empName,age,gender from t_emp where emp_id #{empId}/select2、核心配置文件(mybatis-config.xml)中设置一个全局配置 当字段符合MySQL的要求使用_而属性符合java的要求使用驼峰 此时可以在MyBatis的核心配置文件(mybatis-config.xml)中设置一个全局配置可以自动将下划线映射为驼峰 emp_id:empId,emp_name:empName settings!--将下划线映射为驼峰--setting namemapUnderscoreToCamelCase valuetrue/!--开启延迟加载--setting namelazyLoadingEnabled valuetrue/!--按需加载--setting nameaggressiveLazyLoading valuefalse//settings3、使用resultMap自定义映射处理 resultMap设置自定义映射 属性 id表示自定义映射的唯一标识 type查询的数据要映射的实体类的类型 子标签 id设置主键的映射关系 result设置普通字段的映射关系 association设置多对一的映射关系 collection设置一对多的映射关系 属性 property设置映射关系中实体类中的属性名 column设置映射关系中表中的字段名 resultMap iduserMap typeUser id propertyid columnid/id result propertyuserName columnuser_name/result result propertypassword columnpassword/result result propertyage columnage/result result propertysex columnsex/result /resultMap !--ListUser testMohu(Param(mohu) String mohu);-- select idtestMohu resultMapuserMap !--select * from t_user where username like %${mohu}%-- select id,user_name,password,age,sex from t_user where user_name like concat(%,#{mohu},%) /select1处理多对一的映射关系 多个员工对应一个部门 ①级联方式处理 !-- 级联方式处理--resultMap idempAndDeptResultMapOne typeEmpid columnemp_id propertyempId/idresult columnemp_name propertyempName/resultresult columnage propertyage/resultresult columngender propertygender/resultresult columndept_id propertydept.deptId/resultresult columndept_name propertydept.deptName/result/resultMapselect idgetEmpAndDeptByEmpId resultMapempAndDeptResultMapOneselectt_emp.*,t_dept.*from t_empleft join t_depton t_emp.dept_id t_dept.dept_idwhere t_emp.emp_id #{empId}/select ②association !--association--resultMap idempAndDeptResultMap typeEmpid columnemp_id propertyempId/idresult columnemp_name propertyempName/resultresult columnage propertyage/resultresult columngender propertygender/result!--association处理多对一的映射关系处理实体类类型的属性property设置需要处理映射关系的属性的属性名javaType设置要处理的属性的类型--association propertydept javaTypeDeptid columndept_id propertydeptId/idresult columndept_name propertydeptName/result/association/resultMapselect idgetEmpAndDeptByEmpId resultMapempAndDeptResultMapselectt_emp.*,t_dept.*from t_empleft join t_depton t_emp.dept_id t_dept.dept_idwhere t_emp.emp_id #{empId}/select ③分步查询 DeptMapper.xml部门 select idgetEmpAndDeptByStepTwo resultTypeDeptselect * from t_dept where dept_id #{deptId}/select EmpMapper.xml员工 !--分步查询--resultMap idempAndDeptByStepResultMap typeEmpid columnemp_id propertyempId/idresult columnemp_name propertyempName/resultresult columnage propertyage/resultresult columngender propertygender/result!--property设置需要处理映射关系的属性的属性名select设置分步查询的sql的唯一标识column将查询出的某个字段作为分步查询的sql的条件fetchType在开启了延迟加载的环境中通过该属性设置当前的分步查询是否使用延迟加载fetchTypeeager(立即加载)|lazy(延迟加载)--association propertydept fetchTypeeagerselectcom.atguigu.mybatis.mapper.DeptMapper.getEmpAndDeptByStepTwocolumndept_id/association/resultMapselect idgetEmpAndDeptByStepOne resultMapempAndDeptByStepResultMapselect * from t_emp where emp_id #{empId}/select 2处理一对多的映射关系 一个部门对应多个员工 ①collection resultMap iddeptAndEmpResultMap typeDeptid columndept_id propertydeptId/idresult columndept_name propertydeptName/result!--ofType设置集合类型的属性中存储的数据的类型--collection propertyemps ofTypeEmpid columnemp_id propertyempId/idresult columnemp_name propertyempName/resultresult columnage propertyage/resultresult columngender propertygender/result/collection/resultMapselect idgetDeptAndEmpByDeptId resultMapdeptAndEmpResultMapSELECT *FROM t_deptLEFT JOIN t_empON t_dept.dept_id t_emp.dept_idWHERE t_dept.dept_id #{deptId}/select ②分步查询 DeptMapper.xml部门 resultMap iddeptAndEmpResultMapByStep typeDeptid columndept_id propertydeptId/idresult columndept_name propertydeptName/resultcollection propertyempsselectcom.atguigu.mybatis.mapper.EmpMapper.getDeptAndEmpByStepTwocolumndept_id/collection/resultMap!--Dept getDeptAndEmpByStepOne(Param(deptId) Integer deptId);--select idgetDeptAndEmpByStepOne resultMapdeptAndEmpResultMapByStepselect * from t_dept where dept_id #{deptId}/selectEmpMapper.xml员工 select idgetDeptAndEmpByStepTwo resultTypeEmpselect * from t_emp where dept_id #{deptId}/select
http://www.hkea.cn/news/14405330/

相关文章:

  • 建设网站设计专业服务高端公司网站设计
  • 哪个软件可以做明星视频网站wordpress 被写入文件
  • 网站设计的公司设计青岛网页制作服务
  • 在农村开个网站要多少钱制作h5页面的软件
  • 株洲专业建设网站网站内链检查
  • 大宇网络做网站怎么样深圳货拉拉
  • 广州营销型网站建设哪家好揭阳手机网站建设
  • 建筑公司网站案例做移动类网站的书推荐
  • 自己建设网站模版wordpress页面可以收录文章不收录
  • 深圳建站公司兴田德润官网多少wordpress显示注册人数
  • 怎样自己做公司网站品牌营销咨询
  • 网站建设相关的网站泉州微信网站建设公司
  • 湖南省建设工程造价总站网站网站建设与运营 好考吗
  • 做网站给女朋友开发公司延迟缴纳维修基金申请书
  • server2008 做网站营销策划策划公司
  • 作风建设年活动网站广州十大设计公司
  • 怎么用vs2010做网站现在建站好么
  • 网站开发 支付宝订单号网站搜索引擎优化方案范文
  • 推广网站的图片怎么做wordpress级简主题
  • 岳池网站制作成都教育行业网站建设
  • 普同网站跟营销型网站的区别网站点赞功能
  • wix建设网站手机网站建设制作教程视频教程
  • 网站一般做多大像素长沙专业竞价优化首选
  • 郑州建设银行网站网络推广培训策划
  • 专业网站的定义深圳福永做网站
  • 个人网站论文摘要网站建设服务后所有权归谁
  • 企业网站招聘可以怎么做安装wordpress php
  • 陕西建设机械股份有限公司网站typecho 2 wordpress
  • 泰州网站整站优化模拟版图设计培训
  • 网站改版怎么办asp 企业网站