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


Java Restrictions.isNull方法代码示例

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


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

示例1: getSearchRestrictionCriterion

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
private Criterion getSearchRestrictionCriterion(SelectionRestriction restriction)
{
	switch( restriction )
	{
		case TOP_LEVEL_ONLY:
			return Restrictions.isNull("parent");

		case LEAF_ONLY:
			return Restrictions.sqlRestriction("lft + 1 = rht");

		default:
			return null;
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:15,代码来源:TermServiceImpl.java

示例2: findByIndex

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
@Override
public List<SurveyDirectory> findByIndex() {
    Criterion cri1=Restrictions.eq("visibility", 1);
    Criterion cri2=Restrictions.eq("parentId", "402880e5428a2dca01428a2f1f290000");
    Criterion cri3=Restrictions.eq("surveyTag", 1);
    Criterion cri4=Restrictions.isNull("sid");
    Page<SurveyDirectory> page=new Page<SurveyDirectory>();
    page.setOrderBy("createDate");
	page.setOrderDir("desc");
	page.setPageSize(10);
    List<SurveyDirectory> surveys = surveyDirectoryDao.findPage(page, cri1,cri2,cri3,cri4).getResult();
    return surveys;
}
 
开发者ID:wkeyuan,项目名称:DWSurvey,代码行数:14,代码来源:SurveyDirectoryManagerImpl.java

示例3: findByT1

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
@Override
public List<SurveyDirectory> findByT1() {
    Criterion cri1=Restrictions.eq("visibility", 1);
    Criterion cri2=Restrictions.eq("parentId", "402880e5428a2dca01428a2f1f290000");
    Criterion cri3=Restrictions.eq("surveyTag", 1);
    Criterion cri4=Restrictions.isNull("sid");
    Page<SurveyDirectory> page=new Page<SurveyDirectory>();
    page.setOrderBy("createDate");
	page.setOrderDir("desc");
	page.setPageSize(10);
    List<SurveyDirectory> surveys = surveyDirectoryDao.findPage(page, cri1,cri2,cri3,cri4).getResult();
    return surveys;
}
 
开发者ID:wkeyuan,项目名称:DWSurvey,代码行数:14,代码来源:SurveyDirectoryManagerImpl.java

示例4: getGroupsInGroup

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
private List<TLEGroup> getGroupsInGroup(TLEGroup group)
{
	Criterion c1 = group == null ? Restrictions.isNull("parent") : Restrictions.eq("parent", group);
	return dao.findAllByCriteria(c1);
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:TLEGroupServiceImpl.java

示例5: ofOpen

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
public static Criterion ofOpen() {
	return Restrictions.isNull("closeInfo");
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:4,代码来源:PullRequest.java

示例6: buildCriterion

import org.hibernate.criterion.Restrictions; //导入方法依赖的package包/类
/**
 * 按属性条件参数创建Criterion,辅助函数.
 * 
 * @param propertyName
 *            String
 * @param propertyValue
 *            Object
 * @param matchType
 *            MatchType
 * @return Criterion
 */
public static Criterion buildCriterion(String propertyName,
        Object propertyValue, MatchType matchType) {
    Assert.hasText(propertyName, "propertyName不能为空");

    Criterion criterion = null;

    // 根据MatchType构造criterion
    switch (matchType) {
    case EQ:
        criterion = Restrictions.eq(propertyName, propertyValue);

        break;

    case NOT:
        criterion = Restrictions.ne(propertyName, propertyValue);

        break;

    case LIKE:
        criterion = Restrictions.like(propertyName, (String) propertyValue,
                MatchMode.ANYWHERE);

        break;

    case LE:
        criterion = Restrictions.le(propertyName, propertyValue);

        break;

    case LT:
        criterion = Restrictions.lt(propertyName, propertyValue);

        break;

    case GE:
        criterion = Restrictions.ge(propertyName, propertyValue);

        break;

    case GT:
        criterion = Restrictions.gt(propertyName, propertyValue);

        break;

    case IN:
        criterion = Restrictions.in(propertyName,
                (Collection) propertyValue);

        break;

    case INL:
        criterion = Restrictions.isNull(propertyName);

        break;

    case NNL:
        criterion = Restrictions.isNotNull(propertyName);

        break;

    default:
        criterion = Restrictions.eq(propertyName, propertyValue);

        break;
    }

    return criterion;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:80,代码来源:HibernateUtils.java


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