本文整理了Java中io.ebean.Query.setAllowLoadErrors
方法的一些代码示例,展示了Query.setAllowLoadErrors
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setAllowLoadErrors
方法的具体详情如下:
包路径:io.ebean.Query
类名称:Query
方法名:setAllowLoadErrors
[英]Execute the query allowing properties with invalid JSON to be collected and not fail the query.
// fetch a bean with JSON content
[中]执行查询,以收集包含无效JSON的属性,并且不会使查询失败
// fetch a bean with JSON content
代码示例来源:origin: org.actframework/act-ebean
@Override
public Query<MODEL_TYPE> setAllowLoadErrors() {
q.setAllowLoadErrors();
return this;
}
代码示例来源:origin: io.ebean/ebean-querybean
/**
* Execute the query allowing properties with invalid JSON to be collected and not fail the query.
* <pre>{@code
*
* // fetch a bean with JSON content
* EBasicJsonList bean= new QEBasicJsonList()
* .id.equalTo(42)
* .setAllowLoadErrors() // collect errors into bean state if we have invalid JSON
* .findOne();
*
*
* // get the invalid JSON errors from the bean state
* Map<String, Exception> errors = server().getBeanState(bean).getLoadErrors();
*
* // If this map is not empty tell we have invalid JSON
* // and should try and fix the JSON content or inform the user
*
* }</pre>
*/
public R setAllowLoadErrors() {
query.setAllowLoadErrors();
return root;
}
内容来源于网络,如有侵权,请联系作者删除!