Package org.springframework.dao

Examples of org.springframework.dao.EmptyResultDataAccessException


  @NotNull
  public T findById( @NotNull Long id ) throws DataAccessException {
    T found = type.cast( getHibernateTemplate().get( type, id ) );
    if ( found == null ) {
      throw new EmptyResultDataAccessException( 1 );
    }
    return found;
  }
View Full Code Here


                // 基础类型的抛异常,其他的返回null
                if (returnType.isPrimitive()) {
                    String msg = "Incorrect result size: expected 1, actual " + sizeResult + ": "
                            + runtime.getMetaData();
                    throw new EmptyResultDataAccessException(msg, 1);
                } else {
                    return null;
                }

            } else {
View Full Code Here

      }
      account.restoreBeneficiary(mapBeneficiary(rs));
    }
    if (account == null) {
      // no rows returned - throw an empty result exception
      throw new EmptyResultDataAccessException(1);
    }
    return account;
  }
View Full Code Here

   * @throws EmptyResultDataAccessException if there is no next row
   * @throws SQLException
   */
  private void advanceToNextRow(ResultSet rs) throws EmptyResultDataAccessException, SQLException {
    if (!rs.next()) {
      throw new EmptyResultDataAccessException(1);
    }
  }
View Full Code Here

   * @throws EmptyResultDataAccessException if there is no next row
   * @throws SQLException
   */
  private void advanceToNextRow(ResultSet rs) throws EmptyResultDataAccessException, SQLException {
    if (!rs.next()) {
      throw new EmptyResultDataAccessException(1);
    }
  }
View Full Code Here

        account.restoreBeneficiary(b);
      }
    }
    if (account == null) {
      // no rows returned - throw an empty result exception
      throw new EmptyResultDataAccessException(1);
    }
    return account;
  }
View Full Code Here

   * @return the mapped Account aggregate
   * @throws SQLException an exception occurred extracting data from the result set
   */
  private Account mapAccount(ResultSet rs) throws SQLException {
    if (!rs.next()) {
      throw new EmptyResultDataAccessException(1);
    }

    Account account = null;
    // build out the account object graph from the returned rows
    do {
View Full Code Here

  }

  public Restaurant findByMerchantNumber(String merchantNumber) {
    Restaurant restaurant = (Restaurant) restaurantsByMerchantNumber.get(merchantNumber);
    if (restaurant == null) {
      throw new EmptyResultDataAccessException(1);
    }
    return restaurant;
  }
View Full Code Here

  }

  public Account findByCreditCard(String creditCardNumber) {
    Account account = accountsByCreditCard.get(creditCardNumber);
    if (account == null) {
      throw new EmptyResultDataAccessException(1);
    }
    return account;
  }
View Full Code Here

     * @throws EmptyResultDataAccessException if there is no next row
     * @throws SQLException
     */
    private void advanceToNextRow(ResultSet rs) throws EmptyResultDataAccessException, SQLException {
        if (!rs.next()) {
            throw new EmptyResultDataAccessException(1);
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.dao.EmptyResultDataAccessException

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.