This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Executing aggregate function in ibatis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Executing aggregate function in ibatis" Watch "Executing aggregate function in ibatis" New topic
Author

Executing aggregate function in ibatis

Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi All,

I am trying to run the following query in the ibatis :
Code:



As you can see that it is returning price_list_id along with the customer numbers in each price list. I have a doubt in mapping this query's output to my resultmap class. My result map class is billing_invoice _line which is price_list_id and customer_id as bean properties.
So my mapping looks like:

Code:



I just want to know that the way i am mapping it is it right or not?
I am doubtful about the customer_id mapping as it is returning the count(*).
Is there any other way out of doing this?
Any help will be greatly appreciated.

Thanks and Regards,
Khushwinder
Edit/Delete Message
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
I am getting the following exception in this:



not found in the sql map file.

If any body has any idea please help me out.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Executing aggregate function in ibatis
 
Similar Threads
Metro-iBATIS Problem while deploying web service using iBatis as mapping techonlogy.
How to access resultmaps from another existing result map in iBATIS 2x
IBATIS - multiple parameter
Query from View using iBatis
iBatis and Bidirectional Association