【发布时间】:2014-09-04 07:00:55
【问题描述】:
我有两个班级,例如:
@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;
}
我想在 refId 上加入这两个类,以便在 Account 字段上进行排序,例如:
select c.* from Customer as c inner join Account as a on a.refId=c.refId orderBy a.accountType
有没有办法在条件中进行这样的查询
【问题讨论】: