QueryDefinition q = qb.createQueryDefinition();
DomainObject v = q.addRoot(VideoStore.class);
DomainObject i = v.join("videoInventory");
q.where(v.get("location").get("zipCode").equal("94301").and(
i.value().greaterThan(0)));
q.select(v.get("location").get("street"), i.key().get("title"), i
.value());
String jpql = "SELECT v.location.street, KEY(v2).title, VALUE(v2)"
+ " FROM VideoStore v JOIN v.videoInventory v2"
+ " WHERE v.location.zipCode = '94301' AND VALUE(v2) > 0";