deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akash malik <malikakas...@hotmail.com>
Subject Cannot use Order By on a field in Embedded class in deltaspike 1,6
Date Fri, 21 Apr 2017 07:23:20 GMT

Hi Team


I encountered a issue recently where i was not able to sort a list based on a field present
in one of the embedded classes .


Please let me know if it is a known issue otherwise i will report it .


Please find below description for issue :


I am trying to sort record of my employee class on the basis of updatedOn field. UpdatedOn
field is in class ChangeInfo which is embedded class of employee class. I am doing this using
apache deltaspike.

Example :

Criteria crtieria = findEmployees(); criteria.join(Employee_.changeInfo,where(ChangeInfo.class).orderDesc(ChangeInfo_.updatedOn));

When i use above code , i donot get a order by clause appended in final query.

 @Entity
 @Table(name = "employee")
 public class Employee
 {
    @Id
  @Column(name = "id", unique = true, nullable = false, precision = 9)
   private Long id ;
   @Column(name = "name")
   private String name;
   @Column(name = "designation")
   private String designation;
   @Embedded
   private ChangeInfo changeInfo;

}


public class ChangeInfo {

  @Temporal(TemporalType.TIMESTAMP)
  @Column(name = "updated_on")
  private Date updatedOn;

  @Column(name = "updatedBy")
  private String updatedBy;
}

Regards


Akash Malik

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message