У меня есть следующие таблицы:
create table product (
id int primary key,
sku text unique,
descripcion text
);
create table price_list (
id int primary key,
name text not null
)
create table price_list_item (
id_price_list int,
id_product int,
price decimal(12,2)
)
И поэтому я хотел бы сопоставить эти таблицы с этими классами:
public class PriceList {
private int id;
private String name;
private List<ProductPrice> prices;
.....
}
public class ProductPrice {
private int idProduct;
private String sku;
private String descripcion;
private BigDecimal price
}
Но я не могу найти / понять как это сделать с помощью JPA