@Entity
public class SalesT {
@Id
@GeneratedValue
private int id;
@OneToOne
private Customer customer;
@OneToMany(targetEntity = Product.class)
private List< Map<Product,Integer> > listProduct;// I want to intialize this
public SalesT() {
}
public SalesT(Customer customer, List<Map<Product, Integer>> product) {
this.customer = customer;
this.listProduct = product;
}
}
I want to Initialize List< Map < Product,Integer>> listProduct attribute of the SalesT Class, How do I initialize it?. I tried Like this
List<Map <Product, Integer>> listProduct = new ArrayList <HashMap <Product, Integer>>();
but it is not working.
Thank you.