Exemplo n.º 1
0
 /**
  * Execute callback. It is useful when all the API can not satisfy your requirement.
  *
  * @param config the Config object
  * @param callback the ICallback interface
  */
 Object execute(Config config, ICallback callback) {
   Connection conn = null;
   try {
     conn = config.getConnection();
     return callback.call(conn);
   } catch (Exception e) {
     throw new ActiveRecordException(e);
   } finally {
     config.close(conn);
   }
 }