本文整理了Java中leap.orm.query.Query.firstOrNull
方法的一些代码示例,展示了Query.firstOrNull
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.firstOrNull
方法的具体详情如下:
包路径:leap.orm.query.Query
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!