org.hswebframework.ezorm.core.dsl.Update.set()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中org.hswebframework.ezorm.core.dsl.Update.set()方法的一些代码示例,展示了Update.set()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Update.set()方法的具体详情如下:
包路径:org.hswebframework.ezorm.core.dsl.Update
类名称:Update
方法名:set

Update.set介绍

暂无

代码示例

代码示例来源: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
@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 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
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 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
  @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 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 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 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(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

@Override
@Caching(evict = {
    @CacheEvict(value = "dyn-form-deploy", key = "'form-deploy-version:'+#formId"),
    @CacheEvict(value = "dyn-form-deploy", key = "'form-deploy:'+#formId+':latest'"),
    @CacheEvict(value = "dyn-form", allEntries = true)
})
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public void deploy(String formId) {
  DynamicFormEntity formEntity = selectByPk(formId);
  assertNotNull(formEntity);
  if (Boolean.TRUE.equals(formEntity.getDeployed())) {
    dynamicFormDeployLogService.cancelDeployed(formId);
  }
  List<DynamicFormColumnEntity> columns = selectColumnsByFormId(formId);
  deploy(formEntity, columns, true);
  createUpdate().set(DynamicFormEntity.deployed, true).where(DynamicFormEntity.id, formId).exec();
  try {
    dynamicFormDeployLogService.insert(createDeployLog(formEntity, columns));
    eventPublisher.publishEvent(new FormDeployEvent(formId));
  } catch (Exception e) {
    unDeploy(formId);
    throw e;
  }
}

代码示例来源:origin: org.hswebframework.web/hsweb-system-dynamic-form-local

@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: org.hswebframework.web/hsweb-system-dynamic-form-local

@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();
  }
}

相关文章