List<ConfirmingReceiptT> result2 = service.selectListConfirmingReceiptT(map);
이걸 객체에 List 변수로 받고자 하면 아래와 같이 한다.
public class GetConfirmingReceiptListResponseT { @XmlElement(name = "ConfirmingReceipt") protected List<ConfirmingReceiptT> confirmingReceipt; ...
여기서 문제가 발생.
최상위 객체인 GetConfirmingReceiptListResponseT의 confirmingReceipt에 내용이 담기지 않는 문제가 발생.
대략 일주일 정도 삽질 한 결과 최상위 객체에 달랑 List 변수 하나만 있으면 mybatis가
이걸 인식을 못한다.
해결책은 필요는 없지만 result를 한개더 추가 해 준다.
해결한 resultMap
<resultMap type="kr.co.auction.schema.arche_apisvc.ConfirmingReceiptT" id="ConfirmingReceiptT"> <result property="receiptStatus" column="receiptStatus" /> <result property="sellingType" column="SELLINGTYPE" /> <result property="paymentTimeLimit" column="paymentTimeLimit" /> <association property="orderBase" javaType="kr.co.auction.schema.arche_apisvc.OrderBaseT" > <id property="itemID" column="itemID" /> <result property="orderNo" column="orderNo" /> <result property="itemName" column="itemName" /> <result property="awardQty" column="awardQty" /> <result property="awardAmount" column="awardAmount" /> <result property="deliveryFeeAmount" column="deliveryFeeAmount" /> <result property="buyerName" column="buyerName" /> <result property="buyerID" column="buyerID" /> <result property="groupOrderSeqno" column="groupOrderSeqno" /> <result property="requestOption" column="requestOption" /> <result property="requestOptionPrice" column="requestOptionPrice" /> <result property="sellerStockCode" column="sellerStockCode" /> <result property="orderDate" column="orderDate" /> </association> <association property="addressBase" javaType="kr.co.auction.schema.arche_apisvc.AddressBaseT" > <result property="name" column="name" /> <result property="tel" column="tel" /> <result property="mobileTel" column="mobileTel" /> <result property="email" column="email" /> <result property="postNo" column="postNo" /> <result property="addressPost" column="addressPost" /> <result property="addressDetail" column="addressDetail" /> <result property="addressRoadName" column="addressRoadName" /> </association> </resultMap> <resultMap type="kr.co.auction.schema.arche_apisvc.GetConfirmingReceiptListResponseT" id="GetConfirmingReceiptListResponseT" autoMapping="true"> <result column="ADDUSERCD" /><!-- temp, collection 한개만 있으면, List객체로 반환이 안됨. --> <collection property="confirmingReceipt" ofType="kr.co.auction.schema.arche_apisvc.ConfirmingReceiptT" resultMap="ConfirmingReceiptT" /> </resultMap>
댓글 없음:
댓글 쓰기