我有两个实体:
@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
?