Here are the entity classes:
Code:
public class Product {
protected Integer id;
private List<ProductImage> images;
...
}
Code:
public class ProductImage {
private int id;
private Product product;
private Map<String, ProductImageVersion> versions = new HashMap<String, ProductImageVersion>();
...
}
Code:
public class ProductImageVersion {
private Integer id;
private ProductImage productImage;
private String versionName;
...
}
I need to fetch all products with only one of their images if it exists. How the HSQ is formed?