javaeetutorial
  1. javaeetutorial
  2. JAVAEETUTORIAL-188

Minor error in code example in "Ordering Results" section of Criteria chapter

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.1
    • Fix Version/s: 7.0.2
    • Component/s: doc
    • Labels:
      None

      Description

      There is a small error in the last code example at http://docs.oracle.com/javaee/6/tutorial/doc/gjivm.html#gjiwo

       
      cq.orderBy(cb.asc(owner.get(Owner_.lastName), owner.get(Owner_.firstName)));
      

      CriteriaBuilder.asc does not accept such arguments. It should probably be:

      cq.orderBy(cb.asc(owner.get(Owner_.lastName)), cb.asc(owner.get(Owner_.firstName)));
      

        Activity

        Hide
        Ian Evans added a comment -

        Fixed in source, and it will appear in the next update of the Tutorial.

        Show
        Ian Evans added a comment - Fixed in source, and it will appear in the next update of the Tutorial.

          People

          • Assignee:
            Ian Evans
            Reporter:
            Ian Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: