Spring Specification动态查询连接

时间:2017-06-13 09:27:42

标签: spring spring-data specifications

我有两个实体:

@Entity
public class User{
    @Id
    private String id;
    ...
    private String username;
    private String customerId;
}

public class Customer{
    @Id
    private String id;
    private String name;
}

如何创建动态查询,如:

select * from user where username='...';
select * from user u left join customer c o u.customerId=c.id where c.name='...';

且没有@OneToOne

0 个答案:

没有答案