我有三个对象之间的以下关系
public class ProductEntity {
@Id
private int id;
@OneToMany(mappedBy = "productEntity",
fetch = FetchType.LAZY)
private List<ProductInfoEntity> productInfoEntityList = new ArrayList<>();
@Column(name = "snippet")
private String snippet;
}
public class ProductInfoEntity {
@Id
private int id;
@ManyToOne
@JoinColumn(name = "product_id")
private ProductEntity productEntity;
@ManyToOne
@JoinColumn(name = "support_language_id")
private SupportLanguageEntity supportLanguageEntity;
}
public class SupportLanguageEntity {
@Id
private int id;
@Column("name")
private String name;
}
这是实际的数据库设计:
![enter image description here](https://istack.dev59.com/2vANz.webp)
select * from product_info where product_id = 1 and support_language_id = 2;
我还使用了注释来说明规范,这意味着我使用ProductEntity_、ProductInfoEntity_等。请问您能否为上述查询规范提供完整的工作代码?
谢谢!