Package com.mysema.query.jpa.impl

Examples of com.mysema.query.jpa.impl.JPAQuery.list()


    }

    @Override
    public List<Domain> get(Long... ids) {
        JPAQuery query = query().from(domain).where(domain.id.in(ids));
        List<Domain> list = query.list(domain);
        return list;
    }

    @Override
    public Domain getByUUID(String uuid) {
View Full Code Here


        assertEquals(metadata.getProjection(), metadata2.getProjection());
       
        // create new query
        JPAQuery query2 = new JPAQuery(entityManager, metadata2);
        assertEquals("select cat\nfrom Cat cat\nwhere cat.name = ?1", query2.toString());
        query2.list(cat);       
    }

    public void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
    }
View Full Code Here

        query.distinct().iterate(cat);
        assertProjectionEmpty(query);
        query.distinct().iterate(cat,cat);
        assertProjectionEmpty(query);

        query.list(cat);
        assertProjectionEmpty(query);
        query.list(cat,cat);
        assertProjectionEmpty(query);
        query.distinct().list(cat);
        assertProjectionEmpty(query);
View Full Code Here

        query.distinct().iterate(cat,cat);
        assertProjectionEmpty(query);

        query.list(cat);
        assertProjectionEmpty(query);
        query.list(cat,cat);
        assertProjectionEmpty(query);
        query.distinct().list(cat);
        assertProjectionEmpty(query);
        query.distinct().list(cat,cat);
        assertProjectionEmpty(query);
View Full Code Here

        QCat cat = QCat.cat;
        JPAQuery query = query().from(cat).where(cat.name.isNotNull());
        JPAQuery query2 = query.clone(entityManager);
        assertEquals(query.getMetadata().getJoins(), query2.getMetadata().getJoins());
        assertEquals(query.getMetadata().getWhere(), query2.getMetadata().getWhere());
        query2.list(cat);
    }

    private void assertProjectionEmpty(JPAQuery query) {
        assertTrue(query.getMetadata().getProjection().isEmpty());
    }
View Full Code Here

    query.from(qArtifactVersionNotification)
      .where(qArtifactVersionNotification.user.eq(user))
      .orderBy(qArtifactVersionNotification.creationDate.desc())
      .limit(limit);
   
    return query.list(qArtifactVersionNotification);
  }
 
  @Override
  public List<ArtifactVersionNotification> listNotificationsAfterDate(User user, Date date) {
    JPAQuery query = new JPAQuery(getEntityManager());
View Full Code Here

    query.from(qArtifactVersionNotification)
      .where(qArtifactVersionNotification.user.eq(user))
      .where(qArtifactVersionNotification.creationDate.after(date))
      .orderBy(qArtifactVersionNotification.creationDate.desc());
   
    return query.list(qArtifactVersionNotification);
  }
 
  @Override
  public FollowedArtifact getFollowedArtifact(User user, Artifact artifact) {
    JPAQuery query = new JPAQuery(getEntityManager());
View Full Code Here

    query.from(qUser)
        .join(qUser.groups, qUserGroup)
        .where(qUserGroup.eq(userGroup))
        .orderBy(qUser.lastName.lower().asc(), qUser.firstName.lower().asc());
   
    return query.list(qUser);
  }
}
View Full Code Here

    query.from(qArtifactVersion)
      .where(qArtifactVersion.artifact.eq(artifact))
      .where(qArtifactVersion.lastUpdateDate.gt(date))
      .orderBy(qArtifactVersion.lastUpdateDate.desc());
   
    return query.list(qArtifactVersion);
  }
 
  @Override
  public Artifact getByGroupIdArtifactId(String groupId, String artifactId) {
    JPAQuery query = new JPAQuery(getEntityManager());
View Full Code Here

    query.from(qArtifact)
      .where(qArtifact.deprecationStatus.eq(ArtifactDeprecationStatus.NORMAL))
      .orderBy(qArtifact.followersCount.desc())
      .limit(limit);
   
    return query.list(qArtifact);
  }
 
  @Override
  public List<Artifact> searchAutocomplete(String searchPattern, Integer limit, Integer offset) throws ServiceException {
    String[] searchFields = new String[] {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.