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

x33g5p2x  于2022-01-28 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(177)

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

Query.single介绍

暂无

代码示例

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@Cacheable(cacheNames = "oauth2-access-token", key = "'refresh:'+#refreshToken")
public OAuth2AccessToken getTokenByRefreshToken(String refreshToken) {
  Assert.notNull(refreshToken, "refreshToken can not be null!");
  return DefaultDSLQueryService.createQuery(oAuth2AccessDao)
      .where("refreshToken", refreshToken).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@Cacheable(cacheNames = "oauth2-access-token", key = "'token:'+#accessToken")
public OAuth2AccessToken getTokenByAccessToken(String accessToken) {
  Assert.notNull(accessToken, "accessToken can not be null!");
  return DefaultDSLQueryService.createQuery(oAuth2AccessDao)
      .where("accessToken", accessToken).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Transactional(readOnly = true)
@Cacheable(key = "'code:'+#code")
public OrganizationalEntity selectByCode(String code) {
  if (StringUtils.isEmpty(code)) {
    return null;
  }
  return createQuery().where(OrganizationalEntity.code, code).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
  @Cacheable(key = "'name:'+#name")
  @Transactional(readOnly = true)
  public OrganizationalEntity selectByName(String name) {
    if (StringUtils.isEmpty(name)) {
      return null;
    }

    return createQuery().where(OrganizationalEntity.name, name).single();
  }
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Transactional(readOnly = true)
public UserEntity selectByUsername(String username) {
  if (!StringUtils.hasLength(username)) {
    return null;
  }
  return createQuery().where("username", username).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Transactional(readOnly = true)
public E selectByPk(PK pk) {
  if (StringUtils.isEmpty(pk)) {
    return null;
  }
  return createQuery().where(GenericEntity.id, pk).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'define-id:'+#processDefineId")
public ProcessDefineConfigEntity selectByProcessDefineId(String processDefineId) {
  return createQuery()
      .where("processDefineId", Objects.requireNonNull(processDefineId, "参数[processDefineId]不能为空"))
      .single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'id:'+#id")
public OAuth2Client getClientById(String id) {
  return DefaultDSLQueryService.createQuery(oAuth2ClientDao).where("id", id).single();
}

代码示例来源:origin: hs-web/hsweb-framework

public OAuth2UserTokenEntity selectByAccessToken(String accessToken) {
    Assert.notNull(accessToken, "token can not be null!");
    return createQuery().where(OAuth2UserTokenEntity.accessToken, accessToken)
        .single();
  }
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'code:'+#code")
public DistrictEntity selectByCode(String code) {
  return createQuery().where(DistrictEntity.code, code).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'ownerId:'+#ownerId")
public OAuth2Client getClientByOwnerId(String ownerId) {
  return DefaultDSLQueryService.createQuery(oAuth2ClientDao).where("ownerId", ownerId).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'md5:'+#md5", condition = "#md5!=null")
public FileInfoEntity selectByMd5(String md5) {
  if (null == md5) {
    return null;
  }
  return createQuery().where(FileInfoEntity.md5, md5).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'code:'+#code")
public DepartmentEntity selectByCode(String code) {
  return createQuery().where(DepartmentEntity.code, code).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'user:'+#userId+'.'+#key+'.'+#settingId")
public UserSettingEntity selectByUser(String userId, String key, String settingId) {
  Objects.requireNonNull(userId);
  Objects.requireNonNull(key);
  Objects.requireNonNull(settingId);
  return createQuery().where("userId", userId).and("key", key).and("settingId", settingId).single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
@Cacheable(key = "'define-id:'+#processDefineId+'-'+#activityId")
public ActivityConfigEntity selectByProcessDefineIdAndActivityId(String processDefineId, String activityId) {
  return createQuery()
      .where("processDefineId", processDefineId)
      .and("activityId", activityId)
      .single();
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
  @Cacheable(key = "'id-or-md5:'+#idOrMd5", condition = "#idOrMd5!=null")
  public FileInfoEntity selectByIdOrMd5(String idOrMd5) {
    if (null == idOrMd5) {
      return null;
    }
    return createQuery().where(FileInfoEntity.md5, idOrMd5).or(FileInfoEntity.id, idOrMd5).single();
  }
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
  @Cacheable(key = "'define-key:'+#processDefineKey+'-'+#activityId")
  public ActivityConfigEntity selectByProcessDefineKeyAndActivityId(String processDefineKey, String activityId) {
    return createQuery()
        .where("processDefineKey", processDefineKey)
        .and("activityId", activityId)
        .single();
  }
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
  @Transactional(propagation = Propagation.NOT_SUPPORTED)
  public AuthorizationCode consumeAuthorizationCode(String code) {
    AuthorizationCodeEntity codeEntity = DefaultDSLQueryService
        .createQuery(authorizationCodeDao)
        .where("code", code).single();
    //delete
    DefaultDSLDeleteService.createDelete(authorizationCodeDao)
        .where("code", code).exec();
    return codeEntity;
  }
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
public DynamicFormDeployLogEntity selectDeployed(String formId, long version) {
  Objects.requireNonNull(formId);
  DynamicFormDeployLogEntity deployed = createQuery()
      .where(DynamicFormDeployLogEntity.formId, formId)
      .and(DynamicFormDeployLogEntity.version, version)
      .orderByDesc(DynamicFormDeployLogEntity.deployTime)
      .single();
  if (null != deployed && DataStatus.STATUS_ENABLED.equals(deployed.getStatus())) {
    return deployed;
  }
  return null;
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
public AuthorizationSettingEntity select(String type, String settingFor) {
  tryValidateProperty(type != null, AuthorizationSettingEntity.type, "{can not be null}");
  tryValidateProperty(settingFor != null, AuthorizationSettingEntity.settingFor, "{can not be null}");
  return createQuery().where(AuthorizationSettingEntity.type, type)
      .and(AuthorizationSettingEntity.settingFor, settingFor)
      .single();
}

相关文章