leap.orm.query.Query.firstOrNull()方法的使用及代码示例

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

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

Query.firstOrNull介绍

[英]Executes this query and return the first row.

Returns null if no result returned.
[中]执行此查询并返回第一行。
如果没有返回结果,则返回null

代码示例

代码示例来源:origin: org.leapframework/leap-orm

/**
 * Returns true if the result has records, or returns false if no records.
 */
default boolean exists() {
  return firstOrNull() != null;
}

代码示例来源:origin: org.leapframework/leap-oauth2

protected AuthzClientEntity loadAuthzClientEntity(String clientId){
  AuthzClientEntity entity;
  if(null == loadClientCommand) {
    entity = dao.findOrNull(AuthzClientEntity.class, clientId);
  }else{
    entity = dao.createQuery(AuthzClientEntity.class, loadClientCommand).firstOrNull();
  }
  return entity;
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

protected AuthzClientEntity loadAuthzClientEntity(String clientId){
  AuthzClientEntity entity;
  if(null == loadClientCommand) {
    entity = dao.findOrNull(AuthzClientEntity.class, clientId);
  }else{
    entity = dao.createQuery(AuthzClientEntity.class, loadClientCommand).firstOrNull();
  }
  return entity;
}

代码示例来源:origin: org.leapframework/leap-oauth2

@Override
public AuthzCode loadAuthorizationCode(String code) {
  AuthzCodeEntity entity;
  if(null == loadAuthorizationCodeCommand) {
    entity = dao.findOrNull(AuthzCodeEntity.class, code);
  }else{
    entity = dao.createQuery(AuthzCodeEntity.class, loadAuthorizationCodeCommand).firstOrNull();
  }
  return null == entity ? null : createAuthzCodeFromEntity(entity);
}

代码示例来源:origin: org.leapframework/leap-oauth2-server

@Override
public AuthzCode loadAuthorizationCode(String code) {
  AuthzCodeEntity entity;
  if(null == loadAuthorizationCodeCommand) {
    entity = dao.findOrNull(AuthzCodeEntity.class, code);
  }else{
    entity = dao.createQuery(AuthzCodeEntity.class, loadAuthorizationCodeCommand).firstOrNull();
  }
  return null == entity ? null : createAuthzCodeFromEntity(entity);
}

相关文章