Package com.alexnevsky.hotel.dao

Examples of com.alexnevsky.hotel.dao.AbstractDAOFactory


    logger.info("Admin '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN) + "'. Execute "
        + this.toString() + ". RemoteAddr: " + request.getRemoteAddr());

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      logger.info("Admin '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
View Full Code Here


    logger.info("Customer '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
        + "'. Execute " + this.toString() + ". RemoteAddr: " + request.getRemoteAddr());

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = null;
      order = orderDAO.find(orderId);
View Full Code Here

    logger.info("Admin '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN) + "'. Execute "
        + this.toString() + ". RemoteAddr: " + request.getRemoteAddr());

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      Form form = null;
View Full Code Here

    logger.info("Customer '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN)
        + "'. Execute " + this.toString() + ". RemoteAddr: " + request.getRemoteAddr());

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = null;
      order = orderDAO.find(orderId);
View Full Code Here

   *            The password which is to be checked in the database.
   * @return True if the given user is Admin.
   */
  public boolean isAdmin(String login, String password) throws DAOException {
    boolean success = false;
    AbstractDAOFactory daoFactory = Controller.getDAOFactory();
    AdminDAO adminDAO = daoFactory.getAdminDAO();
    success = adminDAO.existAdmin(login, password);
    return success;
  }
View Full Code Here

   *            The password which is to be checked in the database.
   * @return True if the given user is Customer.
   */
  public boolean isCustomer(String login, String password) throws DAOException {
    boolean success = false;
    AbstractDAOFactory daoFactory = Controller.getDAOFactory();
    CustomerAccountDAO customerAccountDAO = daoFactory.getCustomerAccountDAO();
    success = customerAccountDAO.existCustomerAccount(login, password);
    return success;
  }
View Full Code Here

   *         password, otherwise null.
   * @throws DAOException
   *             If something fails at database level.
   */
  public Admin getAdmin(String login, String password) throws DAOException {
    AbstractDAOFactory daoFactory = Controller.getDAOFactory();
    Admin admin = daoFactory.getAdminDAO().find(login, password);
    return admin;
  }
View Full Code Here

   *         password, otherwise null.
   * @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

    logger.info("Admin '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN) + "'. Execute "
        + this.toString() + ". RemoteAddr: " + request.getRemoteAddr());

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();
      RoomDAO roomDAO = daoFactory.getRoomDAO();

      Order order = null;
      order = orderDAO.find(orderId);

      Form form = null;
View Full Code Here

      page = ConfigurationManager.getInstance().getProperty(ConfigurationManager.ERROR_PAGE_PATH);
      return page;
    }

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      FormDAO formDAO = daoFactory.getFormDAO();
      try {
        formDAO.create(form);
      } catch (IllegalArgumentException ex) {
        logger.error(ex, ex);
      }

      Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);

      Order order = new Order();
      order.setCustomerId(customer.getId());
      order.setFormId(form.getId());

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      try {
        orderDAO.create(order);
      } catch (IllegalArgumentException ex) {
        logger.error(ex, ex);
      }
View Full Code Here

TOP

Related Classes of com.alexnevsky.hotel.dao.AbstractDAOFactory

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.