当前位置: 首页>>代码示例>>Java>>正文


Java Restrictions.and方法代码示例

本文整理汇总了Java中org.hibernate.criterion.Restrictions.and方法的典型用法代码示例。如果您正苦于以下问题:Java Restrictions.and方法的具体用法?Java Restrictions.and怎么用?Java Restrictions.and使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.criterion.Restrictions的用法示例。


在下文中一共展示了Restrictions.and方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildNested

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
private Criterion buildNested(NestedExpression nestedExpression) {
    
    Criterion full = null;

    for (int i = 0; i < nestedExpression.getExpressionCount(); i++) {
        Criterion expr;
        Expression expression = nestedExpression.getExpression(i);

        if (expression.isNested()) {
            expr = buildNested((NestedExpression) nestedExpression.getExpression(i));
        } else {
            FieldExpression sub = (FieldExpression) nestedExpression.getExpression(i);
            expr = queryComparison(sub);

            if (sub.isNegate()) {
                expr = Restrictions.not(expr);
            }
        }

        if (full == null) {
            full = expr;
        } else {
            switch (nestedExpression.getExpressionOperator()) {
            case AND:
                full = Restrictions.and(full, expr);
                break;

            case OR:
                full = Restrictions.or(full, expr);
            }
        }
    }

    return full;
}
 
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:36,代码来源:HibernateStore.java

示例2: on

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
@Transactional
@Listen
public void on(RefUpdated event) {
	String branch = GitUtils.ref2branch(event.getRefName());
	if (branch != null) {
		ProjectAndBranch projectAndBranch = new ProjectAndBranch(event.getProject(), branch);
		Criterion criterion = Restrictions.and(
				ofOpen(), 
				Restrictions.or(ofSource(projectAndBranch), ofTarget(projectAndBranch)));
		for (PullRequest request: findAll(EntityCriteria.of(PullRequest.class).add(criterion))) {
			check(request);
		}
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:15,代码来源:DefaultPullRequestManager.java

示例3: findEffective

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
@Sessional
@Override
public PullRequest findEffective(ProjectAndBranch target, ProjectAndBranch source) {
	EntityCriteria<PullRequest> criteria = EntityCriteria.of(PullRequest.class);
	Criterion merged = Restrictions.and(
			Restrictions.eq("closeInfo.closeStatus", CloseInfo.Status.MERGED), 
			Restrictions.eq("lastMergePreview.requestHead", source.getObjectName()));
	
	criteria.add(ofTarget(target)).add(ofSource(source)).add(Restrictions.or(ofOpen(), merged));
	
	return find(criteria);
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:13,代码来源:DefaultPullRequestManager.java

示例4: ofTarget

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
public static Criterion ofTarget(ProjectAndBranch target) {
	return Restrictions.and(
			Restrictions.eq("targetProject", target.getProject()),
			Restrictions.eq("targetBranch", target.getBranch()));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:6,代码来源:PullRequest.java

示例5: ofSource

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
public static Criterion ofSource(ProjectAndBranch source) {
	return Restrictions.and(
			Restrictions.eq("sourceProject", source.getProject()),
			Restrictions.eq("sourceBranch", source.getBranch()));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:6,代码来源:PullRequest.java


注:本文中的org.hibernate.criterion.Restrictions.and方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。