I have two class such as:
@Entity
public class Customer{
@Id
private String id;
private String name;
@Column(nullable=false, unique=true)
private String refId;
}
@Entity
public class Account{
@Id
private String id;
@Column(nullable=false, unique=true)
private String accountNr;
@Column(nullable=false)
private String accountType;
@Column(nullable=false, unique=true)
private String refId;
}
I want to join this two classes on refId for ordering on a field of Account such as:
select c.* from Customer as c inner join Account as a on a.refId=c.refId orderBy a.accountType
Is there any way to do such query in criteria