本文整理了Java中org.hibernate.criterion.Restrictions.allEq
方法的一些代码示例,展示了Restrictions.allEq
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Restrictions.allEq
方法的具体详情如下:
包路径:org.hibernate.criterion.Restrictions
类名称:Restrictions
方法名:allEq
[英]Apply an "equals" constraint to each property in the key set of a Map
[中]对贴图关键点集中的每个属性应用“等于”约束
代码示例来源:origin: org.grails/grails-hibernate
@Override
public Query allEq(Map<String, Object> values) {
addToCriteria(Restrictions.allEq(values));
return this;
}
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
@Override
public Query allEq(Map<String, Object> values) {
addToCriteria(Restrictions.allEq(values));
return this;
}
代码示例来源:origin: org.grails/grails-hibernate
@Override
public Query allEq(Map<String, Object> values) {
addToCriteria(Restrictions.allEq(values));
return this;
}
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
@Override
public Query allEq(Map<String, Object> values) {
addToCriteria(Restrictions.allEq(values));
return this;
}
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
@Override
public org.grails.datastore.mapping.query.api.Criteria allEq(Map<String, Object> propertyValues) {
addToCriteria( Restrictions.allEq(propertyValues) );
return this;
}
代码示例来源:origin: org.bitbucket.risu8/hibernate
private boolean checkUnique(Serializable target, List<String> columnNames) throws IllegalAccessException {
if (columnNames.isEmpty()) {
return true;
}
Map<String, Object> eqs = new HashMap<>();
for (String col : columnNames) {
String c = StringUtils.removeEnd(col, "_id");
eqs.put(c, FieldUtils.readDeclaredField(target, c));
}
return sessionFactory.getCurrentSession().createCriteria(clazz).add(Restrictions.allEq(eqs)).setProjection(Projections.rowCount()).uniqueResult().equals(0L);
}
}
代码示例来源:origin: com.weicoder/dao
@Override
public <E> List<E> eq(Class<E> entityClass, Map<String, Object> map, int firstResult, int maxResults) {
return queryCriteria(entityClass, DetachedCriteria.forClass(entityClass).add(Restrictions.allEq(map)), firstResult, maxResults);
}
代码示例来源:origin: com.weicoder/dao
@Override
public <E> E get(Class<E> entity, Map<String, Object> map) {
return getCriteria(entity, DetachedCriteria.forClass(entity).add(Restrictions.allEq(map)));
}
代码示例来源:origin: com.weicoder/dao
@Override
public int count(final Class<?> entityClass, final Map<String, Object> map) {
return execute(entityClass, session -> {
// 创建查询条件
Criteria criteria = DetachedCriteria.forClass(entityClass).getExecutableCriteria(session);
// 判断属性名不为空
if (EmptyUtil.isNotEmpty(map))
criteria.add(Restrictions.allEq(map));
// 设置获得总行数
criteria.setProjection(Projections.rowCount());
// 返回结果
return Conversion.toInt(criteria.uniqueResult());
});
}
内容来源于网络,如有侵权,请联系作者删除!