You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Tu...@AlconLabs.com on 2007/01/29 20:00:19 UTC

ORDER BY on multiple columns

Hi,
 
It seems that I missed some things very obvious but I couldn't figure
out what caused the error.
 
I have a multiple columns in the ORDER BY clause as defined in the query
below
 
    <select id="getLineItems" 
            resultClass="lineItemObject" 
            parameterClass="mapObject"> 
         SELECT td.category AS "category",
                td.description AS "description", 
                td.requirement AS "requirement"
        FROM  my_table_xxx td
        JOIN EZIQS.dbo.my_table_yyy ra ON td.record_id = ra.record_id
        WHERE ra.serial_number = #serialNumber#
        AND   ra.job_number = "jobNumber#
        ORDER BY td.category_order, td.description_order, td.test_order
    </select>   
 
It complaints on the second column of the ORDER BY clause. Do I need to
create a map object for the ORDER BY clause? I prefer not to create
three new attributes for the mapping the ORDER BY columns in my
lineItemObject class.
 
com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath
'/sqlMap/select'.  Cause: Caused by: java.lang.RuntimeException:
Description.  Cause: java.lang.RuntimeException: Could not initialize
DaoConfig.  Cause: com.ibatis.dao.client.DaoException: Error while
configuring DaoManager.  Cause: 
 
com.ibatis.common.exception.NestedRuntimeException: Error occurred.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing
XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: 
 
com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath
'/sqlMap/select'.  Cause: com.ibatis.sqlmap.client.SqlMapException:
Unrecognized parameter mapping field: ' td.description_order' in 
        ORDER BY td.category_order, td.description_order, td.test_order

Thanks,
Tuan



This e-mail (including any attachments) is confidential and may be legally privileged. If you are not an intended recipient or an authorized representative of an intended recipient, you are prohibited from using, copying or distributing the information in this e-mail or its attachments. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete all copies of this message and any attachments.
Thank you.