本文整理了Java中org.hswebframework.ezorm.core.dsl.Update.where()
方法的一些代码示例,展示了Update.where()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Update.where()
方法的具体详情如下:
包路径:org.hswebframework.ezorm.core.dsl.Update
类名称:Update
方法名:where
暂无
代码示例来源:origin: hs-web/hsweb-framework
@Override
public boolean disable(String userId) {
if (!StringUtils.hasLength(userId)) {
return false;
}
return createUpdate(getDao())
.set(UserEntity.status, DataStatus.STATUS_DISABLED)
.where(GenericEntity.id, userId)
.exec() > 0;
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public void disable(String id) {
Objects.requireNonNull(id);
createUpdate()
.set(OrganizationalEntity.status, DataStatus.STATUS_DISABLED)
.where(OrganizationalEntity.id, id)
.exec();
publisher.publishEvent(new ClearPersonCacheEvent());
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void cancelDeployed(String formId, long version) {
Objects.requireNonNull(formId);
createUpdate()
.set(DynamicFormDeployLogEntity.status, DataStatus.STATUS_DISABLED)
.where(DynamicFormDeployLogEntity.formId, formId)
.and(DynamicFormDeployLogEntity.version, version)
.exec();
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public void disable(String id) {
Objects.requireNonNull(id);
createUpdate()
.set(DistrictEntity.status, DataStatus.STATUS_DISABLED)
.where(DistrictEntity.id, id)
.exec();
publisher.publishEvent(new ClearPersonCacheEvent());
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public void enable(String id) {
Objects.requireNonNull(id);
createUpdate()
.set(OrganizationalEntity.status, DataStatus.STATUS_ENABLED)
.where(OrganizationalEntity.id, id)
.exec();
publisher.publishEvent(new ClearPersonCacheEvent());
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public boolean enable(String userId) {
if (!StringUtils.hasLength(userId)) {
return false;
}
return createUpdate(getDao())
.set(UserEntity.status, DataStatus.STATUS_ENABLED)
.where(GenericEntity.id, userId)
.exec() > 0;
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public void enable(String id) {
Objects.requireNonNull(id);
createUpdate()
.set(DistrictEntity.status, DataStatus.STATUS_ENABLED)
.where(DistrictEntity.id, id)
.exec();
publisher.publishEvent(new ClearPersonCacheEvent());
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void disable(String roleId) {
tryValidateProperty(StringUtils.hasLength(roleId), RoleEntity.id, "{id_is_null}");
DefaultDSLUpdateService.createUpdate(getDao())
.set(RoleEntity.status, DataStatus.STATUS_DISABLED)
.where(RoleEntity.id, roleId)
.exec();
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void enable(String roleId) {
tryValidateProperty(StringUtils.hasLength(roleId), RoleEntity.id, "{id_is_null}");
DefaultDSLUpdateService.createUpdate(getDao())
.set(RoleEntity.status, DataStatus.STATUS_ENABLED)
.where(RoleEntity.id, roleId)
.exec();
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void enable(String id) {
Objects.requireNonNull(id);
int size = createUpdate().set(ScheduleJobEntity.status, DataStatus.STATUS_ENABLED)
.where(ScheduleJobEntity.id, id).exec();
if (size > 0) {
startJob(selectByPk(id));
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void disable(String id) {
Objects.requireNonNull(id);
int size = createUpdate().set(ScheduleJobEntity.status, DataStatus.STATUS_DISABLED)
.where(ScheduleJobEntity.id, id).exec();
if (size > 0) {
deleteJob(selectByPk(id));
}
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public void enable(String id) {
tryValidateProperty(StringUtils.hasLength(id), MenuGroupEntity.id, "{id_is_null}");
createUpdate()
.set(MenuGroupEntity.status, 1)
.where(MenuGroupEntity.id, id)
.exec();
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public int updateByPk(PK pk, E entity) {
Assert.notNull(pk, "primary key can not be null");
Assert.hasText(String.valueOf(pk), "primary key can not be null");
Assert.notNull(entity, "entity can not be null");
entity.setId(pk);
tryValidate(entity, UpdateGroup.class);
return createUpdate(entity)
//如果是RecordCreationEntity则不修改creator_id和creator_time
.when(entity instanceof RecordCreationEntity,
update -> update.and().excludes(((RecordCreationEntity) entity).getCreatorIdProperty(), RecordCreationEntity.createTime))
.where(GenericEntity.id, pk)
.exec();
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@CacheEvict(allEntries = true)
public void disable(String id) {
tryValidateProperty(StringUtils.hasLength(id), MenuGroupEntity.id, "{id_is_null}");
DefaultDSLUpdateService
.createUpdate(getDao())
.set(MenuGroupEntity.status, 0)
.where(MenuGroupEntity.id, id)
.exec();
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void cancelDeployed(String formId) {
Objects.requireNonNull(formId);
DynamicFormDeployLogEntity deployed = createQuery()
.where(DynamicFormDeployLogEntity.formId, formId)
.orderByDesc(DynamicFormDeployLogEntity.deployTime)
.single();
if (deployed != null) {
createUpdate()
.set(DynamicFormDeployLogEntity.status, DataStatus.STATUS_DISABLED)
.where(DynamicFormDeployLogEntity.id, deployed.getId())
.exec();
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public E deleteByPk(PK pk) {
E old = selectByPk(pk);
if (old == null) {
return null;
}
if (old instanceof LogicalDeleteEntity) {
LogicalDeleteEntity deleteEntity = (LogicalDeleteEntity) old;
deleteEntity.setDeleted(true);
deleteEntity.setDeleteTime(System.currentTimeMillis());
createUpdate()
.set(deleteEntity::getDeleted)
.set(deleteEntity::getDeleteTime)
.where(GenericEntity.id, pk)
.exec();
} else {
getDao().deleteByPk(pk);
}
return old;
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void updatePassword(String userId, String oldPassword, String newPassword) {
UserEntity userEntity = selectByPk(userId);
assertNotNull(userEntity);
oldPassword = encodePassword(oldPassword, userEntity.getSalt());
if (!userEntity.getPassword().equals(oldPassword)) {
throw new ValidationException("密码错误", "password");
}
tryValidateProperty(passwordStrengthValidator, UserEntity.password, newPassword);
newPassword = encodePassword(newPassword, userEntity.getSalt());
createUpdate(getDao())
.set(UserEntity.password, newPassword)
.where(GenericEntity.id, userId)
.exec();
publisher.publishEvent(new UserModifiedEvent(userEntity, true, false));
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@Caching(put = {
@CachePut(key = "'ownerId:'+#result.ownerId"),
@CachePut(key = "'id:'+#result.id")
})
public OAuth2Client save(OAuth2Client oAuth2Client) {
OAuth2Client old = getClientById(oAuth2Client.getId());
if (old != null) {
DefaultDSLUpdateService
.createUpdate(oAuth2ClientDao, oAuth2Client)
.excludes("id", "createTime")
.where("id", oAuth2Client.getId()).exec();
} else {
oAuth2ClientDao.insert(((SimpleOAuth2ClientEntity) oAuth2Client));
}
return oAuth2Client;
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
@Caching(evict = {
@CacheEvict(value = "dyn-form-deploy", allEntries = true),
@CacheEvict(value = "dyn-form", allEntries = true),
})
public void unDeploy(String formId) {
DynamicFormEntity form = selectByPk(formId);
assertNotNull(form);
//取消发布
dynamicFormDeployLogService.cancelDeployed(formId);
//移除表结构定义
RDBDatabase database = StringUtils.isEmpty(form.getDataSourceId())
? databaseRepository.getDefaultDatabase()
: databaseRepository.getDatabase(form.getDataSourceId());
database.removeTable(form.getDatabaseTableName());
createUpdate().set(DynamicFormEntity.deployed, false).where(DynamicFormEntity.id, formId).exec();
eventPublisher.publishEvent(new FormDeployEvent(formId));
}
代码示例来源: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();
}
内容来源于网络,如有侵权,请联系作者删除!