JPA2.0 Join联结查询
2012-05-23 16:16:34 来源:WEB开发网核心提示:CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); CriteriaQuery<Photo> cq = cb.createQuery(Photo.class); Root<Photo> root_ = cq.from
CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); CriteriaQuery<Photo> cq = cb.createQuery(Photo.class); Root<Photo> root_ = cq.from(Photo.class); Join<Photo, ServiceItem> join = root_.join(Photo_.serviceItems, JoinType.LEFT); cq.select(root_);
JPA2.0 join联结查询
CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); CriteriaQuery<Photo> cq = cb.createQuery(Photo.class); Root<Photo> root_ = cq.from(Photo.class); Join<Photo, ServiceItem> join = root_.join(Photo_.serviceItems, JoinType.LEFT); cq.select(root_);
更多精彩
赞助商链接