Christian Wilhelm created OLINGO-644:
----------------------------------------

             Summary: JPA Processor loose order by mutliple sort criteria
                 Key: OLINGO-644
                 URL: https://issues.apache.org/jira/browse/OLINGO-644
             Project: Olingo
          Issue Type: Bug
          Components: odata2-jpa
    Affects Versions: V2 2.0.3
            Reporter: Christian Wilhelm


Hi Colleagues,

We want to sort a table regarding 3 different columns. The sort priority is of 
course important, but it does not work as expected.


First Example „Read Raw Materials“:

Within the Chrome-Debugger you can see that the GET is called in the right way:

 

On the other hand the SQL Tracing on the Server looks like this:

SELECT UUID, ASSIGNEDCR, COMPLETEDCR, MISSING_REQ_DATA, NOT_COMPLIANT_REQS, 
PRIORITY, RAW_MATERIAL_ID, RAWMATERIAL_NAME, RESPONSIBLE_USER_GROUP_UUID, 
USED_IN_PRODUCTS FROM MONITORRAWMATERIAL 
ORDER BY PRIORITY DESC, USED_IN_PRODUCTS DESC, RAWMATERIAL_NAME

Order Prio      Call from Frontend (GET)        SQL Call in JPA
----------------------------------------------------------------------------
1.              RawMaterialName                 PRIORITY
2.              UsedInProducts                  USED_IN_PRODUCTS
3.              Priority                                        RAWMATERIAL_NAME

A Second Example shows the following Order Prio:
Summary:

Order Prio      Call from Frontend (GET)        SQL Call in JPA
----------------------------------------------------------------
1.              ProductName                     PRODUCT_NAME
2.              InworkCR                                PRIORITY
3.              Priority                                INWORKCR



Found Debugging Information:

Debugging the OData-Source provides following information for us:

•       In the Class ODataExpressionParser and function 
parseToJPAOrderByExpression() the (still sorted) orderByExpression is stored in 
the orderByMap.
•       In the Class JPQLSelectStatementBuilder and function  createJPQLQuery() 
the hash map is read by iterator (=> unsorted).





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to