title: How to order descending the data in hibernate
body: <p>I want to order the data descending in hibernate,
  but not working at all,</p>
  
  <p>this is my code,</p>
  
  <pre><code>@SuppressWarnings("unchecked")
  @Override
  public List&lt;MPNValas&gt; listAllMPNValas() throws Exception{
      DetachedCriteria criteria = DetachedCriteria.forClass(MPNValas.class);
      criteria.addOrder(Order.desc("ID"));
      List&lt;MPNValas&gt; mpnvalasList = getHibernateTemplate().findByCriteria(criteria);
      return mpnvalasList;
  }
  </code></pre>
  
  <p>this is my controller,</p>
  
  <pre><code>@RequestMapping("/admin/mpn-valas.html")
  public ModelAndView listMPNValas(ModelMap model)throws Exception
  {
      User user           = (User)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
      String sessionUser  = user.getUsername();
  
      try{
          UserAdmin dataUser = userService.get(sessionUser);
          model.addAttribute("userData", dataUser);
      } catch(Exception e){
          e.printStackTrace();
      }
  
      ModelAndView mav = new ModelAndView("mpnvalas");
      List&lt;MPNValas&gt; mpnvalas = mpnvalasService.listAllMPNValas();
      mav.addObject("mpnvalas", mpnvalas);
      return mav;
  
  }
  </code></pre>
  
  <p>and this is the class,</p>
  
  <pre><code>package prod.support.model.gwprod;
  
  import javax.persistence.Column;
  import javax.persistence.Id;
  import javax.persistence.Entity;
  import javax.persistence.Table;
  
  @Entity
  @Table(name="LOOKUP")
  public class MPNValas {
  
  private Integer ID;
  private String TIPE;
  private String KODE_PERUSAHAAN;
  private String CODE;
  private String NAME;
  private String VALUE;
  
  @Id
  @Column(name="ID", unique=true, nullable=false)
  public Integer getID() {
      return ID;
  }
  public void setID(Integer ID) {
      this.ID = ID;
  }
  @Column(name="TIPE")
  public String getTIPE() {
      return TIPE;
  }
  public void setTIPE(String TIPE) {
      this.TIPE = TIPE;
  }
  @Column(name="KODE_PERUSAHAAN")
  public String getKODE_PERUSAHAAN() {
      return KODE_PERUSAHAAN;
  }
  public void setKODE_PERUSAHAAN(String KODE_PERUSAHAAN) {
      this.KODE_PERUSAHAAN = KODE_PERUSAHAAN;
  }
  @Column(name="CODE")
  public String getCODE() {
      return CODE;
  }
  public void setCODE(String CODE) {
      this.CODE = CODE;
  }
  @Column(name="NAME")
  public String getNAME() {
      return NAME;
  }
  public void setNAME(String NAME) {
      this.NAME = NAME;
  }
  @Column(name="VALUE")
  public String getVALUE() {
      return VALUE;
  }
  public void setVALUE(String VALUE) {
      this.VALUE = VALUE;
  }
  
  
  
  /**
   * @param args
   */
  
  }
  </code></pre>
  
  <p>and this the list of data</p>
  
  <p><img src="https://i.stack.imgur.com/jp4HB.jpg" alt="list data"></p>
  
  <p>that I miss something??</p>
  
  <p>any help will be pleasure :))</p>