jakartaee / persistence

https://jakartaee.github.io/persistence/
Other
208 stars 59 forks source link

Join map key #164

Open lukasj opened 6 years ago

lukasj commented 6 years ago

MapJoin.key() return a Path which can not be a join source. For example,

@Entity
public class Store {
     @ElementCollection(fetch=FetchType.LAZY)
     Map<Merchandise, Integer> inventory;
}

@Entity
public class Merchandise {
     @ManyToOne
      Supplier supplier;
}

CriteriaQuery criteriaQuery = criteriaBuilder.createCriteriaQuery(Store.class);
Root root = criteriaQuery.from(Store.class);
root.joinMap("inventory").key().join("supplier");

The key() return a Path that can not join any association or element collection. Join source must be a From.

  1. need a way to specify the lazy fetch type for map key (Merchandise)?
  2. need a way to join or join fetch map key (Merchandise)?
lukasj commented 6 years ago