播放框架中的订单相关实体

Order related entities in play framework

假设我在 play 框架中有两个实体 类,java:

@Entity
public class User extends Model implements Validation {
    @Id
    private String email;
    private String password;
    @OneToOne
    @PrimaryKeyJoinColumn(referencedColumnName = "userEmail")
    private Address address;}

@Entity
public class Address extends Model{
    @Id
    @Column(name="userEmail")
    private String email;
    private String streetName;
    private String city;
    private String country;}

现在我想从数据库中检索所有用户并根据 Address 模型的街道名称 属性 对它们进行排序。我用这个 List<Restaurant> list = Restaurant.find.order("streetName asc").findList();

但我收到以下错误:

[PersistenceException: Query threw SQLException:Unknown column 'streetName' in 'order clause' 
Bind values:[] 

如果我将任何用户 属性 作为订单字符串 (...order("email asc").findList(); ) 它可以工作并且我得到了有序列表,但是我怎样才能让它根据地址属性对用户进行排序?

尝试Restaurant.find.order("address.streetName asc").findList()