Package com.alexnevsky.hotel.model

Examples of com.alexnevsky.hotel.model.CustomerAccount


   * @throws DAOException
   *             If something fails at database level.
   */
  public Customer getCustomer(String login, String password) throws DAOException {
    AbstractDAOFactory daoFactory = Controller.getDAOFactory();
    CustomerAccount customerAccount = daoFactory.getCustomerAccountDAO().find(login, password);
    Customer customer = daoFactory.getCustomerDAO().find(customerAccount.getId());
    return customer;
  }
View Full Code Here


   */
  private CustomerAccount find(String sql, Object... values) throws DAOException {
    Connection connection = null;
    PreparedStatement preparedStatement = null;
    ResultSet resultSet = null;
    CustomerAccount customerAccount = null;

    try {
      connection = this.daoFactory.getConnection();
      preparedStatement = prepareStatement(connection, sql, false, values);
      resultSet = preparedStatement.executeQuery();
View Full Code Here

   * @return The mapped CustomerAccount from the current row of the given ResultSet.
   * @throws SQLException
   *             If something fails at database level.
   */
  private static CustomerAccount mapCustomerAccount(ResultSet resultSet) throws SQLException {
    return new CustomerAccount(resultSet.getLong("id"), resultSet.getString("login"),
        resultSet.getString("password"));
  }
View Full Code Here

TOP

Related Classes of com.alexnevsky.hotel.model.CustomerAccount

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.