association 的使用

	<resultMap id="wmsTaskMap" type="WmsTask">

		<id column="ID" jdbcType="DECIMAL" property="id" />
		<result column="TYPE" jdbcType="VARCHAR" property="type" />
		<result column="INVENTORY_STATUS" jdbcType="VARCHAR" property="inventoryStatus" />
		<result column="SRC_INVENTORY_ID" jdbcType="DECIMAL" property="srcInventoryId" />
		<result column="SRC_LOCATION_ID" jdbcType="DECIMAL" property="srcLocationId" />
		<result column="SRC_LOCATION_CODE" jdbcType="VARCHAR" property="srcLocationCode" />
		<result column="DEST_INVENTORY_ID" jdbcType="DECIMAL" property="destInventoryId" />
		<result column="DEST_LOCATION_ID" jdbcType="DECIMAL" property="destLocationId" />
		<result column="DEST_LOCATION_CODE" jdbcType="VARCHAR" property="destLocationCode" />
		<result column="PLAN_QUANTITY_BU" jdbcType="DECIMAL" property="planQuantityBU" />
		<result column="MOVED_QUANTITY_BU" jdbcType="DECIMAL" property="movedQuantityBU" />
		<result column="STATUS" jdbcType="VARCHAR" property="status" />

		<result property="info.creatorId" column="CREATOR_ID" />
		<result property="info.creator" column="CREATOR" />
		<result property="info.createdTime" column="CREATED_TIME" />
		<result property="info.lastOperatorId" column="LAST_OPERATOR_ID" />
		<result property="info.lastOperator" column="LAST_OPERATOR" />
		<result property="info.lastOperatedTime" column="LAST_OPERATED_TIME" />

		<association property="worker" column="WORKER_ID" javaType="User">
			<id column="ID" jdbcType="DECIMAL" property="id" />
		</association>
		<association property="productKey" column="PRODUCT_KEY_ID" javaType="WmsProductKey">
			<id column="ID" jdbcType="DECIMAL" property="id" />
		</association>
		<association property="workDoc" column="WORK_DOC_ID" javaType="WmsWorkDoc">
			<id column="ID" jdbcType="DECIMAL" property="id" />
			<!-- 单据编号 -->
			<result column="CODE" jdbcType="VARCHAR" property="code" />
		</association>
		<!--  -->
		<association property="moveDocDetail" column="MOVE_DOC_DETAIL_ID" javaType="WmsMoveDocDetail">
			<id column="ID" jdbcType="DECIMAL" property="id" />
			<association property="product" column="PRODUCT_ID" javaType="BisProduct">
				<id column="ID" jdbcType="DECIMAL" property="id" />
				<result column="CODE" jdbcType="VARCHAR" property="code" />
				<result column="NAME" jdbcType="VARCHAR" property="name" />
			</association>
		</association>
		<!-- 包装级别 -->
		<association property="packageLevel" column="PACKAGE_LEVEL_ID"
			javaType="BisPackageLevel"
			select="com.jshuabo.logistics.server.dao.bis.product.IBisPackageLevelMapper.load" />

	</resultMap>

为什么 association 关联不出信息, 只有Id:

<association property="moveDocDetail" column="MOVE_DOC_DETAIL_ID" javaType="WmsMoveDocDetail">
			<id column="ID" jdbcType="DECIMAL" property="id" />
			<association property="product" column="PRODUCT_ID" javaType="BisProduct">
				<id column="ID" jdbcType="DECIMAL" property="id" />
				<result column="CODE" jdbcType="VARCHAR" property="code" />
				<result column="NAME" jdbcType="VARCHAR" property="name" />
			</association>
		</association>

我这样写有问题吗?

association 的使用,布布扣,bubuko.com

时间: 2024-11-07 00:26:27

association 的使用的相关文章

Mybatis 高级结果映射 ResultMap Association Collection

作者:ilovejava_2010 MyBatis的创建基于这样一个思想:数据库并不是您想怎样就怎样的.虽然我们希望所有的数据库遵守第三范式或BCNF(修正的第三范式),但它们不是.如果有一个数据库能够完美映射到所有应用程序,也将是非常棒的,但也没有.结果集映射就是MyBatis为解决这些问题而提供的解决方案.例如,我们如何映射下面这条语句? <!-- Very Complex Statement --> <select id="selectBlogDetails"

Kattis - Association for Computing Machinery

Association for Computing Machinery ACM (Association for Computing Machinery) organizes the International Collegiate Programming Contest (ICPC) worldwide every year. In the ICPC, a team of three students is presented with a problem set that contains 

mybatis association表关联与rowbounds共同使用时的异常及其解决方案

按照mybatis手册中所说的,association有两种实现方式,嵌套查询和嵌套结果映射.如手册中所述,select方式会带来N+1次查询的问题,考虑到效率问题的话建议使用嵌套结果映射.但是在结合使用rowbounds进行分页的时候嵌套结果映射会报Mapped Statements with nested result mapping cannot be safely constrained by rowbounds异常.经过测试发现是rowbounds和resultmap-associat

mybatis association和collection标签怎么用

<resultMap type="Bill" id="ResultBill"> <id property="id" column="id"/> <result property="dh" column="dh"  /> <result property="rq" column="rq"/> <a

Inheritance, Association, Aggregation, and Composition 类的继承,关联,聚合和组合的区别

在C++中,类与类之间的关系大概有四种,分别为继承,关联,聚合,和组合.其中继承我们大家应该都比较熟悉,因为是C++的三大特性继承Inheritance,封装Encapsulation,和多态Polymorphism之一. 继承Inheritance:是指一个类(子类)来继承另一个类(基类),并增加自己的功能,可以通过重写基类中的函数来实现.可以将继承理解成“IS A”的关系,比如A cat "IS A" animal, or A car "IS A" vehicl

USB组合设备 Interface Association Descriptor (IAD)

Communication Device Class,简称CDCUSB Compound Device,USB复合设备USB Composite Device,USB组合设备 摘要USB复合设备 Compound Device内嵌Hub和多个Function,每个Function都相当于一个独立的USB外设,有自己的PID/VID.USB组合设备Composite Device内只有一个Function,只有一套PID/VID,通过将不同的interface定义为不同的类来实现多个功能的组合.

An association from the table content refers to an

今天hibernate报了一个错:An association from the table content refers to an unmapped class:com.blog.content.kind 经查,发现是content.hbm.xml里面的Kind类全名错了.由于之前改动过数据库表,在content表里引入了外键kind_fk,然后用myeclipse自动生成Content类和相应的hbm.xml文件时,就会出现这样的错误!

【智能家居篇】wifi网络接入原理(下)——关联Association

转载请注明出处:http://blog.csdn.net/Righthek 谢谢! 认证完成后,下一步就是关联(Association). 工作站与基站进行关联,以便获得网络的完全访问权.关联属于一种记录(record keeping)过程,它让分布式系统(Distribution System)得以记录每个移动式工作站的位置,以便将传送给移动式工作站的帧,转送给正确的基站.形成关联之后,基站必须为该移动式工作站在网络上注册,如此一来,发送给该移动式工作站的帧,才会转送至其所属基站.其中一种注册

org.hibernate.MappingException: An association from the table order_intem_inf refers to a unmapped

运行一个HIbernate的示例时出现如下错误信息 Exception in thread "main" java.lang.ExceptionInInitializerError at com.hibernate.utils.HibernateUtil.<clinit>(HibernateUtil.java:21) at org.hibernate.samples.PersonManager.main(PersonManager.java:23) Caused by: o