I am having issues writing an expression query in apache cayenne to retrieve the records from the database.
My requirement is to retrieve the orders from a table which is created by a particular UserDn, where Order Status is not complete. It is not giving results as expected.
I used the below query, but it is giving results only created by UserDn and ignoring the and expression "Order Status is not complete".
Expression expression = ExpressionFactory.matchExp(SAPOrder.CREATED_BY_USER_DN_PROPERTY, userDN );
expression.andExp(ExpressionFactory.noMatchExp(SAPOrder.ORDER_STATUS_PROPERTY, "Completed"));
SelectQuery query = new SelectQuery(SAPOrder.class, expression);