Java 类org.apache.ibatis.session.SqlSessionException 实例源码

项目:MybatisCode    文件:GeneralExceptionsTest.java   
@Test
public void shouldInstantiateAndThrowAllCustomExceptions() throws Exception {
  Class<?>[] exceptionTypes = {
      BindingException.class,
      CacheException.class,
      DataSourceException.class,
      ExecutorException.class,
      LogException.class,
      ParsingException.class,
      BuilderException.class,
      PluginException.class,
      ReflectionException.class,
      PersistenceException.class,
      SqlSessionException.class,
      TransactionException.class,
      TypeException.class, 
      ScriptingException.class
  };
  for (Class<?> exceptionType : exceptionTypes) {
    testExceptionConstructors(exceptionType);
  }

}
项目:mybatis    文件:GeneralExceptionsTest.java   
@Test
public void shouldInstantiateAndThrowAllCustomExceptions() throws Exception {
  Class<?>[] exceptionTypes = {
      BindingException.class,
      CacheException.class,
      DataSourceException.class,
      ExecutorException.class,
      LogException.class,
      ParsingException.class,
      BuilderException.class,
      PluginException.class,
      ReflectionException.class,
      PersistenceException.class,
      SqlSessionException.class,
      TransactionException.class,
      TypeException.class, 
      ScriptingException.class
  };
  for (Class<?> exceptionType : exceptionTypes) {
    testExceptionConstructors(exceptionType);
  }

}
项目:mybaties    文件:GeneralExceptionsTest.java   
@Test
public void shouldInstantiateAndThrowAllCustomExceptions() throws Exception {
  Class<?>[] exceptionTypes = {
      BindingException.class,
      CacheException.class,
      DataSourceException.class,
      ExecutorException.class,
      LogException.class,
      ParsingException.class,
      BuilderException.class,
      PluginException.class,
      ReflectionException.class,
      PersistenceException.class,
      SqlSessionException.class,
      TransactionException.class,
      TypeException.class, 
      ScriptingException.class
  };
  for (Class<?> exceptionType : exceptionTypes) {
    testExceptionConstructors(exceptionType);
  }

}
项目:play    文件:GeneralExceptionsTest.java   
@Test
public void shouldInstantiateAndThrowAllCustomExceptions() throws Exception {
  Class<?>[] exceptionTypes = {
      BindingException.class,
      CacheException.class,
      DataSourceException.class,
      ExecutorException.class,
      LogException.class,
      ParsingException.class,
      BuilderException.class,
      PluginException.class,
      ReflectionException.class,
      PersistenceException.class,
      SqlSessionException.class,
      TransactionException.class,
      TypeException.class, 
      ScriptingException.class
  };
  for (Class<?> exceptionType : exceptionTypes) {
    testExceptionConstructors(exceptionType);
  }

}
项目:mybatis-3    文件:GeneralExceptionsTest.java   
@Test
public void shouldInstantiateAndThrowAllCustomExceptions() throws Exception {
  Class<?>[] exceptionTypes = {
      BindingException.class,
      CacheException.class,
      DataSourceException.class,
      ExecutorException.class,
      LogException.class,
      ParsingException.class,
      BuilderException.class,
      PluginException.class,
      ReflectionException.class,
      PersistenceException.class,
      SqlSessionException.class,
      TransactionException.class,
      TypeException.class, 
      ScriptingException.class
  };
  for (Class<?> exceptionType : exceptionTypes) {
    testExceptionConstructors(exceptionType);
  }

}
项目:easy-mybatis    文件:MybatisDaoImpl.java   
/**
 * 统计匹配的总记录数
 *
 * @param mapperId
 * @param object
 * @return
 */
@Override
public int count(String mapperId, Object object) {
    Integer integer = getSqlSessionTemplate().selectOne(mapperId, object);
    if(integer == null){
        throw new SqlSessionException("Error:  Sql statement is only support select count/sum from tablename. Please check sql statement");
    }
    return integer;
}
项目:easy-mybatis    文件:MybatisDaoImpl.java   
/**
 * 统计匹配的总记录数
 *
 * @param mapperId
 * @param object
 * @return
 */
@Override
public int count(String mapperId, Object object) {
    Integer integer = getSqlSessionTemplate().selectOne(mapperId, object);
    if(integer == null){
        throw new SqlSessionException("Error:  Sql statement is only support select count/sum from tablename. Please check sql statement");
    }
    return integer;
}