ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hemant.Kamatgi <Hemant.Kama...@target.com>
Subject RE: Basic mapping in iBatis
Date Mon, 30 Jul 2007 14:20:26 GMT
Try this(query and result map shown just as an example):

<sqlMap namespace="order">

<resultMap name="OrderMap" class="Order" groupby="id">

	<result property="id" column="ORDER_I">
	<result property="orderItemList" resultMap="order.OrderItemMap">

<resultMap name="OrderItemMap" class="OrderItems">

	<result property="id" column="ORDER_ITEM_I" />

<select name=getOrderDetails" parameterClass="Order"

	Select *
	From	Order or,
		OrderItem oi
	Where	or.id=#id#
	And	or.id=oi.id



-----Original Message-----
From: HHB [mailto:hubaghdadi@yahoo.ca] 
Sent: Friday, July 27, 2007 6:21 PM
To: user-java@ibatis.apache.org
Subject: Basic mapping in iBatis

I have these two entites: Order and OrderItem
class Order {
  List orderItems;
class OrderItems {
  Order order;
How to map this relationship at the XML level?
How can I load an Order with all its order items are fully initialized
(no 1
+ N problem please)?
Thanks for help.
View this message in context:
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message