當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。