本文整理匯總了Java中org.hibernate.criterion.Restrictions.isNotNull方法的典型用法代碼示例。如果您正苦於以下問題:Java Restrictions.isNotNull方法的具體用法?Java Restrictions.isNotNull怎麽用?Java Restrictions.isNotNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.hibernate.criterion.Restrictions
的用法示例。
在下文中一共展示了Restrictions.isNotNull方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deleteExpiredAccessEntries
import org.hibernate.criterion.Restrictions; //導入方法依賴的package包/類
@Override
@Transactional
public void deleteExpiredAccessEntries()
{
Criterion c1 = Restrictions.isNotNull("expiry");
Criterion c2 = Restrictions.lt("expiry", new Date());
for( AccessEntry entry : aclDao.findAllByCriteria(c1, c2) )
{
aclDao.delete(entry);
}
}
示例2: ofClosed
import org.hibernate.criterion.Restrictions; //導入方法依賴的package包/類
public static Criterion ofClosed() {
return Restrictions.isNotNull("closeInfo");
}
示例3: 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;
}