本文整理汇总了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;
}