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

手机网站静态模板怎么注册核酸检测公司

手机网站静态模板,怎么注册核酸检测公司,家纺网站模板,软件技术是什么专业1.关系型数据库#xff1f; 数据库中的表对象之间是有关系的。 一对一#xff0c;一对多#xff0c;多对多。 ORM映射。数据库表映射到实体对象。 实体与实体之间是有关系的。 一对多的关系。 比如商品分类表与商品表之间的关系#xff0c;就是一对多的关系。 入库主表与入…1.关系型数据库   数据库中的表对象之间是有关系的。   一对一一对多多对多。   ORM映射。数据库表映射到实体对象。              实体与实体之间是有关系的。  一对多的关系。  比如商品分类表与商品表之间的关系就是一对多的关系。      入库主表与入库子表之间的关系也是一对多的关系。      出库主表与出库子表之间的关系也是一对多的关系。 ID编号  教师编号   课程编号   其余字段  外键的都是多的关系 1        001 2        001 很明显的就是在多的这个表里会出现1的这个表里的字段。     2.如果我们获取的时候只想获取单表的数据    尽可能不用关联查询的时候就不用。   延迟加载也叫懒加载比如我们取商品信息表的数据只会从商品信息表里去获取如果发现我们除了取商品信息表的数据的时候还会取商品分类表的数据那么这个时候才会去查询商品分类表的数据。   实现延迟加载的步骤   1首先需要配置mybatis中使用延迟加载       !-- lazyLoadingEnabled设置为懒加载--setting namelazyLoadingEnabled valuetrue/!-- aggressiveLazyLoading主动加载设置为false --setting nameaggressiveLazyLoading valuefalse/       2需要配置jar包cglib的jar包。       !-- mybatis懒加载需要引入的jar包cglib包 --dependencygroupIdcglib/groupIdartifactIdcglib-nodep/artifactIdversion3.1/version/dependency   3.实体与实体之间的关系设定。 设计思路在产品实体类中会有一个产品分类的实体对象。   在分类的实体对象中会有一个产品表的集合对象数据。 比如产品表那么会有一个产品分类的实体对象 public class GoodsInfo implements Serializable{private Integer goodsid;private Integer goodstypeid;//外键private Integer companyid;private Integer unitid;private String createuser;private String updateuser;private String commdityid;private String commdityname;private String describeit;private String createtime;private String updatetime;private String remark;private String ifdelete;//会有一个外键的实体对象数据private GoodsType goodsType; } 映射的配置(配置在实体XML里面) ?xml version1.0 encodingUTF-8 ? !DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtd mapper namespacecom.jinglin.hotelsup.dao.imp.GoodsInfoMapper !-- type是告诉将要映射的实体类id就是标记名 -- !-- 实现懒加载的结果集延迟加载 -- resultMap typeGoodsInfo idgoodsInfoLazyResultMap!-- column表示的是数据库的列名property是对应的属性名 --id columngoodsid propertygoodsid/!--result表示数据库的字段和对象的字段的映射column表示列名property表示的是对象的属性名 --result columngoodstypeid propertygoodstypeid/resultresult columncompanyid propertycompanyid /resultresult columnunitid propertyunitid/resultresult columncreateuser propertycreateuser/resultresult columnupdateuser propertyupdateuser/resultresult columncommdityid propertycommdityid/resultresult columncommdityname propertycommdityname/resultresult columndescribeit propertydescribeit/resultresult columncreatetime propertycreatetime/resultresult columnupdatetime propertyupdatetime/resultresult columnremark propertyremark/resultresult columnifdelete propertyifdelete/result!--关联另外一个实体对象 --association propertygoodsType selectgetgoodstypeonecolumngoodstypeid/association /resultMap select idselectOne resultMapgoodsInfoLazyResultMap parameterTypejava.lang.Integerselect * from goodsinfo where goodsid#{goodsid} /select select idgetgoodstypeone resultTypeGoodsType parameterTypejava.lang.Integerselect * from goodstype where goodstypeid#{goodstypeid} /select /mapper 2对于产品分类表那么会对应到多个产品实际就是在产品分类表里会有产品的集合 public class GoodsType implements Serializable {private Integer goodstypeid;private String goodstypename;private String ifdel;//分类表里会出现多的产品的集合private ListGoodsInfo listgoods;public ListGoodsInfo getListgoods() {return listgoods;}public void setListgoods(ListGoodsInfo listgoods) {this.listgoods listgoods;}public Integer getGoodstypeid() {return goodstypeid;}public void setGoodstypeid(Integer goodstypeid) {this.goodstypeid goodstypeid;}public String getGoodstypename() {return goodstypename;}public void setGoodstypename(String goodstypename) {this.goodstypename goodstypename;}public String getIfdel() {return ifdel;}public void setIfdel(String ifdel) {this.ifdel ifdel;}} 那么对应的映射结果集(配置在对应产品类型的xml里面): ?xml version1.0 encodingUTF-8 ? !DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtd mapper namespacecom.jinglin.hotelsup.dao.imp.GoodsTypeMapper!-- 配置延迟加载的映射结果集 --resultMap typeGoodsType idgoodsTypeLazyResultMap!-- 配置主键 --id columngoodstypeid propertygoodstypeid/idresult columngoodstypename propertygoodstypename/resultresult columnifdel propertyifdel/result!-- 配置集合 --collection selectselectgoods propertylistgoods columngoodstypeid/collection/resultMapselect idselectOne resultMapgoodsTypeLazyResultMap parameterTypejava.lang.Integerselect * from goodstype where ifdelN and goodstypeid#{goodstypeid}/selectselect idselectgoods resultMapcom.jinglin.hotelsup.dao.imp.GoodsInfoMapper.goodsInfoLazyResultMap parameterTypejava.lang.Integerselect * from goodsinfo where goodstypeid#{goodstypeid}/select/mapper  转载于:https://www.cnblogs.com/ljljava/p/7440725.html
http://www.zqtcl.cn/news/549423/

相关文章:

  • 为您打造高端品牌网站pageadmin wordpress
  • 中小型网站建设的基本流程简约网站欣赏
  • 设备上哪个网站做外贸推广网络服务类型及其所采用的网络协议
  • 学习前端开发的网站动漫设计属于什么大类
  • 十堰秦楚网 十堰新闻门户网站报修网站模板
  • 家居小程序源码下载自动seo系统
  • 动态效果的网站建设技术老闵行是指哪里
  • 电商网站开发面临的技术问题做闪图的网站
  • 怎么查看网站开发语言的类型东莞哪些地方是风险区
  • 不用购买域名做网站广州网站建设培训学校
  • 城市轨道建设规范下载网站古网站典模板
  • 关于实验室建设的英文网站深圳企业网站制作公司怎样
  • wordpress全站背景音乐中山网站搜索排名
  • 搭建网站的过程透明主题wordpress
  • 丰台网站建设公司电话深圳微信商城网站设计公司
  • 做淘宝要用的网站吗上海微信网站
  • 佛山高端网站制作公司wordpress 发送邮件插件
  • 类似站酷的设计类网站网站建设需要待摊吗
  • 用php做视频网站在学做网站还不知道买什么好
  • wordpress培训类网站网站建设 好
  • 网站开发需要2个月吗网站建设案例精粹
  • 网站建设项目职责营销型网站建设五大内容
  • 建设工程监理招标网站W做网站
  • 网站建设与维护教学课件网站上线前做环境部署
  • 信誉好的网站建设做网站成为首富的外国人
  • 常州网站制作市场湖北省荆门市城乡建设网站
  • 泉州网站制作运营商专业北京软件公司招聘信息查询
  • 车床加工东莞网站建设网站建设教学改进
  • 深圳专业做网站建设西安网站建设有限公司
  • wordpress 一键建站wordpress子主题style