Examples of JPAQuery


Examples of com.mysema.query.jpa.impl.JPAQuery

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

Examples of com.mysema.query.jpa.impl.JPAQuery

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

Examples of com.mysema.query.jpa.impl.JPAQuery

    return query.singleResult(qFollowedArtifact);
  }
 
  @Override
  public List<User> listByUserGroup(UserGroup userGroup) {
    JPAQuery query = new JPAQuery(getEntityManager());
    QUser qUser = QUser.user;
    QUserGroup qUserGroup = QUserGroup.userGroup;
   
    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

Examples of com.mysema.query.jpa.impl.JPAQuery

  @Autowired
  private IHibernateSearchService hibernateSearchService;
 
  @Override
  public List<ArtifactVersion> listArtifactVersionsAfterDate(Artifact artifact, Date date) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifactVersion)
      .where(qArtifactVersion.artifact.eq(artifact))
      .where(qArtifactVersion.lastUpdateDate.gt(date))
      .orderBy(qArtifactVersion.lastUpdateDate.desc());
   
    return query.list(qArtifactVersion);
  }
View Full Code Here

Examples of com.mysema.query.jpa.impl.JPAQuery

    return query.list(qArtifactVersion);
  }
 
  @Override
  public Artifact getByGroupIdArtifactId(String groupId, String artifactId) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifact)
      .where(qArtifact.group.groupId.eq(groupId))
      .where(qArtifact.artifactId.eq(artifactId));
   
    return query.uniqueResult(qArtifact);
  }
View Full Code Here

Examples of com.mysema.query.jpa.impl.JPAQuery

    return query.uniqueResult(qArtifact);
  }
 
  @Override
  public List<Artifact> listMostFollowedArtifacts(int limit) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifact)
      .where(qArtifact.deprecationStatus.eq(ArtifactDeprecationStatus.NORMAL))
      .orderBy(qArtifact.followersCount.desc())
      .limit(limit);
   
    return query.list(qArtifact);
  }
View Full Code Here

Examples of com.mysema.query.jpa.impl.JPAQuery

  private static final QArtifactVersion qArtifactVersion = QArtifactVersion.artifactVersion;
 
  @Override
  public ArtifactVersion getByArtifactAndVersion(Artifact artifact, String version) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifactVersion)
      .where(qArtifactVersion.artifact.eq(artifact),
          qArtifactVersion.version.eq(version));
   
    return query.singleResult(qArtifactVersion);
  }
View Full Code Here

Examples of com.mysema.query.jpa.impl.JPAQuery

    return query.singleResult(qArtifactVersion);
  }
 
  @Override
  public List<ArtifactVersion> listRecentReleases(int limit) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifactVersion)
      .where(qArtifactVersion.artifact.deprecationStatus.eq(ArtifactDeprecationStatus.NORMAL))
      .orderBy(qArtifactVersion.lastUpdateDate.desc())
      .limit(limit);
   
    return query.list(qArtifactVersion);
  }
View Full Code Here

Examples of com.mysema.query.jpa.impl.JPAQuery

 
  private static final QArtifactNotificationRule qArtifactNotificationRule = QArtifactNotificationRule.artifactNotificationRule;
 
  @Override
  public ArtifactNotificationRule getByFollowedArtifactAndRegex(FollowedArtifact followedArtifact, String regex) {
    JPAQuery query = new JPAQuery(getEntityManager());
   
    query.from(qArtifactNotificationRule)
      .where(qArtifactNotificationRule.followedArtifact.eq(followedArtifact))
      .where(qArtifactNotificationRule.regex.eq(regex));
   
    return query.uniqueResult(qArtifactNotificationRule);
  }
View Full Code Here

Examples of com.spaceprogram.simplejpa.query.JPAQuery

* Time: 6:00:24 PM
*/
public class QueryTests {
    @Test
    public void testWhere(){
        JPAQuery query = new JPAQuery();
        JPAQueryParser parser;
        List<String> split;

        parser = new JPAQueryParser(query, ("select o from MyTestObject o where o.myTestObject2.id = :id2 and 1=1 OR o.myTestObject2.name = 'larry'"));
        parser.parse();
        split = QueryImpl.tokenizeWhere(query.getFilter());
        Assert.assertEquals(11, split.size());
        Assert.assertEquals("o.myTestObject2.id = :id2 and 1 = 1 OR o.myTestObject2.name = 'larry' ", toString(split));
    }
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.