本文整理匯總了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;
}
}
示例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;
}
示例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;
}
示例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);
}
示例5: ofOpen
import org.hibernate.criterion.Restrictions; //導入方法依賴的package包/類
public static Criterion ofOpen() {
return Restrictions.isNull("closeInfo");
}
示例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;
}