代码拉取完成,页面将自动刷新
同步操作将从 flatfish/Java-Review 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
exceptions
org.apache.ibatis.exceptions.IbatisException
,实现 RuntimeException 类,IBatis 的异常基类
@Deprecated
public class IbatisException extends RuntimeException {
private static final long serialVersionUID = 3880206998166270511L;
public IbatisException() {
super();
}
public IbatisException(String message) {
super(message);
}
public IbatisException(String message, Throwable cause) {
super(message, cause);
}
public IbatisException(Throwable cause) {
super(cause);
}
}
org.apache.ibatis.exceptions.PersistenceException
,继承 IbatisException 类,目前 MyBatis 真正的异常基类
@SuppressWarnings("deprecation")
public class PersistenceException extends IbatisException {
private static final long serialVersionUID = -7537395265357977271L;
public PersistenceException() {
super();
}
public PersistenceException(String message) {
super(message);
}
public PersistenceException(String message, Throwable cause) {
super(message, cause);
}
public PersistenceException(Throwable cause) {
super(cause);
}
}
org.apache.ibatis.exceptions.ExceptionFactory
,异常工厂public class ExceptionFactory {
private ExceptionFactory() {
// Prevent Instantiation
}
// 被包装成 PersistenceException
// message 消息
// e 异常
public static RuntimeException wrapException(String message, Exception e) {
return new PersistenceException(ErrorContext.instance().message(message).cause(e).toString(), e);
}
}
org.apache.ibatis.exceptions.TooManyResultsException
,继承 PersistenceException 类,查询返回过多结果的异常。期望返回一条,实际返回了多条public class TooManyResultsException extends PersistenceException {
private static final long serialVersionUID = 8935197089745865786L;
public TooManyResultsException() {
super();
}
public TooManyResultsException(String message) {
super(message);
}
public TooManyResultsException(String message, Throwable cause) {
super(message, cause);
}
public TooManyResultsException(Throwable cause) {
super(cause);
}
}
public class ParsingException extends PersistenceException {
private static final long serialVersionUID = -176685891441325943L;
public ParsingException() {
super();
}
public ParsingException(String message) {
super(message);
}
public ParsingException(String message, Throwable cause) {
super(message, cause);
}
public ParsingException(Throwable cause) {
super(cause);
}
}
实际上,我们会看到其他包,会和 parsing
包一样,都会定义其独有的异常类。但是,代码都是相同的。所以,这里就简单整理如下:
reflection
包:ReflectionException
logging
包:LogException
builder
包:BuilderException、IncompleteElementException
scripting
包:ScriptingException
binding
包:BindingException
type
包:TypeException
session
包:SqlSessionException
cache
包:CacheException
transaction
包:TransactionException
datasource
包:DataSourceException
executor
包:ResultMapException、ExecutorException、BatchExecutorException
plugin
包:PluginException
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。