本文整理了Java中org.hibernate.criterion.Example.excludeZeroes()
方法的一些代码示例,展示了Example.excludeZeroes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Example.excludeZeroes()
方法的具体详情如下:
包路径:org.hibernate.criterion.Example
类名称:Example
方法名:excludeZeroes
[英]Exclude zero-valued properties. Equivalent to calling #setPropertySelector passing in NotNullOrZeroPropertySelector#INSTANCE
[中]排除零值属性。相当于调用#setPropertySelector传入NotNullOrZeroPropertySelector#实例
代码示例来源:origin: hibernate/hibernate-orm
.add( Example.create(m).excludeProperty("bigDecimal") )
.createCriteria("otherMaster")
.add( Example.create(m).excludeZeroes().excludeProperty("bigDecimal") )
.uniqueResult();
assertTrue( m1.getOtherMaster()==m1 );
代码示例来源:origin: hibernate/hibernate-orm
list = s.createCriteria(Foo.class).add(
Example.create(example)
.excludeZeroes()
.ignoreCase()
.excludeProperty("bool")
.excludeZeroes()
.enableLike(MatchMode.ANYWHERE)
.excludeProperty("bool")
代码示例来源:origin: nilzao/soapbox-race
@Override
@SuppressWarnings("unchecked")
public List<ISoapBoxEntity> find(ISoapBoxEntity entity) {
EntityManager manager = ConnectionDB.getManager();
manager.clear();
Session sessao = (Session) manager.getDelegate();
Example example = Example.create(entity);
example.excludeZeroes();
Criteria criteria = sessao.createCriteria(entity.getClass());
criteria.add(example);
return criteria.list();
}
代码示例来源:origin: org.fornax.cartridges/fornax-cartridges-sculptor-framework
protected Example createExample() {
return Example.create(exampleInstance).excludeZeroes().ignoreCase().enableLike();
}
代码示例来源:origin: dayatang/dddlib
@Override
public <T extends Entity, E extends T> List<T> findByExample(final E example, final ExampleSettings<T> settings) {
Example theExample = Example.create(example);
if (settings.isLikeEnabled()) {
theExample.enableLike(MatchMode.ANYWHERE);
}
if (settings.isIgnoreCaseEnabled()) {
theExample.ignoreCase();
}
if (settings.isExcludeNone()) {
theExample.excludeNone();
}
if (settings.isExcludeZeroes()) {
theExample.excludeZeroes();
}
for (String propName : settings.getExcludedProperties()) {
theExample.excludeProperty(propName);
}
return getSession().createCriteria(settings.getEntityClass()).add(theExample).list();
}
内容来源于网络,如有侵权,请联系作者删除!