本文整理了Java中org.hswebframework.ezorm.core.dsl.Query.total
方法的一些代码示例,展示了Query.total
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.total
方法的具体详情如下:
包路径:org.hswebframework.ezorm.core.dsl.Query
类名称:Query
方法名:total
暂无
代码示例来源:origin: hs-web/hsweb-framework
@Override
default int count() {
return createQuery().total();
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public DepartmentEntity deleteByPk(String id) {
if (DefaultDSLQueryService.createQuery(positionDao)
.where(PositionEntity.departmentId, id)
.total() > 0) {
throw new BusinessException("部门下存在职位信息,无法删除!");
}
publisher.publishEvent(new ClearPersonCacheEvent());
return super.deleteByPk(id);
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public OrganizationalEntity deleteByPk(String id) {
if (DefaultDSLQueryService.createQuery(departmentDao)
.where(DepartmentEntity.orgId, id)
.total() > 0) {
throw new BusinessException("机构下存在部门信息,无法删除");
}
publisher.publishEvent(new ClearPersonCacheEvent());
return super.deleteByPk(id);
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public DistrictEntity deleteByPk(String id) {
if (DefaultDSLQueryService.createQuery(organizationalDao).where(OrganizationalEntity.districtId, id).total() > 0) {
throw new BusinessException("行政区域下存在机构信息,无法删除!");
}
publisher.publishEvent(new ClearPersonCacheEvent());
return super.deleteByPk(id);
}
代码示例来源:origin: hs-web/hsweb-framework
private String saveOrUpdate0(DynamicFormColumnEntity columnEntity) {
if (StringUtils.isEmpty(columnEntity.getId())
|| DefaultDSLQueryService.createQuery(formColumnDao)
.where(DynamicFormColumnEntity.id, columnEntity.getId())
.total() == 0) {
if (StringUtils.isEmpty(columnEntity.getId())) {
columnEntity.setId(getIDGenerator().generate());
}
tryValidate(columnEntity, CreateGroup.class);
formColumnDao.insert(columnEntity);
} else {
tryValidate(columnEntity, UpdateGroup.class);
DefaultDSLUpdateService
.createUpdate(formColumnDao, columnEntity)
.where(DynamicFormColumnEntity.id, columnEntity.getId())
.exec();
}
return columnEntity.getId();
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@Caching(put = {
@CachePut(cacheNames = "oauth2-access-token", key = "'refresh:'+#result.refreshToken"),
@CachePut(cacheNames = "oauth2-access-token", key = "'token:'+#result.accessToken"),
@CachePut(cacheNames = "oauth2-access-token", key = "'cgo'+#result.clientId+#result.grantType+#result.ownerId")
})
public OAuth2AccessToken saveOrUpdateToken(OAuth2AccessToken token) {
Assert.notNull(token, "token can not be null!");
int total = DefaultDSLQueryService
.createQuery(oAuth2AccessDao)
.where("clientId", token.getClientId())
.and("grantType", token.getGrantType())
.and("ownerId", token.getOwnerId()).total();
token.setUpdateTime(System.currentTimeMillis());
if (total > 0) {
DefaultDSLUpdateService
.createUpdate(oAuth2AccessDao, token)
.where("clientId", token.getClientId())
.and("grantType", token.getGrantType())
.and("ownerId", token.getOwnerId())
.exec();
} else {
token.setCreateTime(System.currentTimeMillis());
oAuth2AccessDao.insert(((OAuth2AccessEntity) token));
}
return token;
}
}
代码示例来源:origin: hs-web/hsweb-framework
.is(PersonEntity.userId, oldUser.getId())
.not(PersonEntity.id, bindEntity.getId())
.total();
tryValidateProperty(userBindSize == 0, "personUser.username", "用户已绑定其他人员");
代码示例来源:origin: hs-web/hsweb-easy-orm
public int total() {
return proxy.total();
}
代码示例来源:origin: hs-web/hsweb-easy-orm
public int total(Query.TotalExecutor<Q> executor) {
return proxy.total(executor);
}
代码示例来源:origin: org.hswebframework.web/hsweb-commons-service-simple
@Override
default int count() {
return createQuery().total();
}
代码示例来源:origin: org.hswebframework.web/hsweb-system-dynamic-form-local
private String saveOrUpdate0(DynamicFormColumnEntity columnEntity) {
if (StringUtils.isEmpty(columnEntity.getId())
|| DefaultDSLQueryService.createQuery(formColumnDao)
.where(DynamicFormColumnEntity.id, columnEntity.getId())
.total() == 0) {
if (StringUtils.isEmpty(columnEntity.getId())) {
columnEntity.setId(getIDGenerator().generate());
}
tryValidate(columnEntity, CreateGroup.class);
formColumnDao.insert(columnEntity);
} else {
tryValidate(columnEntity, UpdateGroup.class);
DefaultDSLUpdateService
.createUpdate(formColumnDao, columnEntity)
.where(DynamicFormColumnEntity.id, columnEntity.getId())
.exec();
}
return columnEntity.getId();
}
代码示例来源:origin: org.hswebframework.web/hsweb-system-oauth2-server-local
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@Caching(put = {
@CachePut(cacheNames = "oauth2-access-token", key = "'refresh:'+#result.refreshToken"),
@CachePut(cacheNames = "oauth2-access-token", key = "'token:'+#result.accessToken"),
@CachePut(cacheNames = "oauth2-access-token", key = "'cgo'+#result.clientId+#result.grantType+#result.ownerId")
})
public OAuth2AccessToken saveOrUpdateToken(OAuth2AccessToken token) {
Assert.notNull(token, "token can not be null!");
int total = DefaultDSLQueryService
.createQuery(oAuth2AccessDao)
.where("clientId", token.getClientId())
.and("grantType", token.getGrantType())
.and("ownerId", token.getOwnerId()).total();
token.setUpdateTime(System.currentTimeMillis());
if (total > 0) {
DefaultDSLUpdateService
.createUpdate(oAuth2AccessDao, token)
.where("clientId", token.getClientId())
.and("grantType", token.getGrantType())
.and("ownerId", token.getOwnerId())
.exec();
} else {
token.setCreateTime(System.currentTimeMillis());
oAuth2AccessDao.insert(((OAuth2AccessEntity) token));
}
return token;
}
}
内容来源于网络,如有侵权,请联系作者删除!