本文整理汇总了Java中com.querydsl.jpa.impl.JPAQuery.fetchOne方法的典型用法代码示例。如果您正苦于以下问题:Java JPAQuery.fetchOne方法的具体用法?Java JPAQuery.fetchOne怎么用?Java JPAQuery.fetchOne使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.querydsl.jpa.impl.JPAQuery
的用法示例。
在下文中一共展示了JPAQuery.fetchOne方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getByProjectAndVersion
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public ProjectVersion getByProjectAndVersion(Project project, String version) {
JPAQuery<ProjectVersion> query = new JPAQuery<>(getEntityManager());
query
.select(qProjectVersion)
.from(qProjectVersion)
.where(qProjectVersion.project.eq(project))
.where(qProjectVersion.version.eq(version));
return query.fetchOne();
}
示例2: getOldGoogleOpenIdProfile
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public User getOldGoogleOpenIdProfile(String email) {
JPAQuery<User> query = new JPAQuery<>(getEntityManager());
QUser qUser = QUser.user;
query.select(qUser).from(qUser).where(qUser.userName.eq(email + "__" + AuthenticationType.OPENID_GOOGLE))
.where(qUser.authenticationType.eq(AuthenticationType.OPENID_GOOGLE));
return query.fetchOne();
}
示例3: getByGroupIdArtifactId
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public Artifact getByGroupIdArtifactId(String groupId, String artifactId) {
JPAQuery<Artifact> query = new JPAQuery<>(getEntityManager());
query
.select(qArtifact)
.from(qArtifact)
.where(qArtifact.group.groupId.eq(groupId))
.where(qArtifact.artifactId.eq(artifactId));
return query.fetchOne();
}
示例4: getByFollowedArtifactAndRegex
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public ArtifactNotificationRule getByFollowedArtifactAndRegex(FollowedArtifact followedArtifact, String regex) {
JPAQuery<ArtifactNotificationRule> query = new JPAQuery<>(getEntityManager());
query
.select(qArtifactNotificationRule)
.from(qArtifactNotificationRule)
.where(qArtifactNotificationRule.followedArtifact.eq(followedArtifact))
.where(qArtifactNotificationRule.regex.eq(regex));
return query.fetchOne();
}
示例5: getByArtifactAndVersion
import com.querydsl.jpa.impl.JPAQuery; //导入方法依赖的package包/类
@Override
public ArtifactVersion getByArtifactAndVersion(Artifact artifact, String version) {
JPAQuery<ArtifactVersion> query = new JPAQuery<>(getEntityManager());
query.select(qArtifactVersion)
.from(qArtifactVersion)
.where(qArtifactVersion.artifact.eq(artifact),
qArtifactVersion.version.eq(version));
return query.fetchOne();
}