Package org.eweb4j.orm.dao

Examples of org.eweb4j.orm.dao.DAOException


        List<T> list = JdbcUtil.getList(con, clazz, sql);
        if (list != null && !list.isEmpty()) {
          result = list.get(0);
        }
      } catch (Exception e) {
        throw new DAOException("", e);
      }
    }
    return result;
  }
View Full Code Here


        List<T> list = JdbcUtil.getList(con, clazz, sql);
        if (list != null && !list.isEmpty()) {
          result = list.get(0);
        }
      } catch (Exception e) {
        throw new DAOException("", e);
      }
    }
    return result;
  }
View Full Code Here

        if (StringUtil.isNumeric(str)) {
          result = Integer.parseInt(str);
        }
      }
    } catch (Exception e) {
      throw new DAOException("", e);
    }
    return result;
  }
View Full Code Here

      con = ds.getConnection();
      T t = clazz.newInstance();
      String sql = SqlFactory.getSelectSql(t, dbType).select(condition);
      result = JdbcUtil.getListWithArgs(con, clazz, sql, args);
    } catch (Exception e) {
      throw new DAOException("", e);
    }
    return result;
  }
View Full Code Here

    Connection con = null;
    try {
      con = ds.getConnection();
      result = JdbcUtil.getListWithArgs(con, clazz, sql, args);
    } catch (Exception e) {
      throw new DAOException("", e);
    }

    return result;
  }
View Full Code Here

        if (StringUtil.isNumeric(str)) {
          result = Integer.parseInt(str);
        }
      }
    } catch (Exception e) {
      throw new DAOException("", e);
    }
    return result;
  }
View Full Code Here

      trans.commit();
    } catch (Exception e) {
      try {
        trans.rollback();// 回滚事务
      } catch (SQLException e1) {
        throw new DAOException("roll back exception ", e);
      }
      String info = StringUtil.getExceptionString(e);
      LogFactory.getORMLogger("info").write(info);
      throw new DAOException("transaction execute exception ", e);
    } finally {
      try {
        trans.close();
      } catch (SQLException e) {
        throw new DAOException("transaction close exception ", e);
      }
    }
  }
View Full Code Here

        con = ds.getConnection();
        List<T> list = JdbcUtil.getList(con, clazz, SqlFactory
            .getSelectSql(t, dbType).nextOne());
        return list != null && !list.isEmpty() ? list.get(0) : null;
      } catch (Exception e) {
        throw new DAOException("nextOne exception ", e);
      }
    }
    return null;
  }
View Full Code Here

        List<T> list = JdbcUtil.getList(con, clazz,
            SqlFactory.getSelectSql(clazz.newInstance(), dbType)
                .nextOne(column, value));
        return list != null && !list.isEmpty() ? list.get(0) : null;
      } catch (Exception e) {
        throw new DAOException("nextOne exception ", e);
      }
    }
    return null;
  }
View Full Code Here

        @SuppressWarnings("unchecked")
        List<T> list = JdbcUtil.getList(con, (Class<T>) t.getClass(),
            SqlFactory.getSelectSql(t, dbType).preOne());
        return list != null && !list.isEmpty() ? list.get(0) : null;
      } catch (Exception e) {
        throw new DAOException("preOne exception ", e);
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eweb4j.orm.dao.DAOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.