Examples of OrderDao


Examples of com.alexnevsky.hotel.dao.OrderDAO

    StringBuilder sb = new StringBuilder();

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      List<Order> orderList = null;
      orderList = orderDAO.listWhereCustomer(this.customerId);

      FormDAO formDAO = daoFactory.getFormDAO();
      Form form = null;

      RoomDAO roomDAO = daoFactory.getRoomDAO();
View Full Code Here

Examples of com.alexnevsky.hotel.dao.OrderDAO

    Customer customer = null;

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

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

      order = orderDAO.find(this.orderId);
      form = formDAO.find(order.getFormId());
      customer = customerDAO.find(order.getCustomerId());
    } catch (DAOException ex) {
      logger.error(ex, ex);
      return MessageManager.DAO_EXCEPTION_ERROR_MESSAGE;
View Full Code Here

Examples of com.alexnevsky.hotel.dao.OrderDAO

    StringBuilder sb = new StringBuilder();

    try {
      AbstractDAOFactory daoFactory = Controller.getDAOFactory();

      OrderDAO orderDAO = daoFactory.getOrderDAO();
      FormDAO formDAO = daoFactory.getFormDAO();
      CustomerDAO customerDAO = daoFactory.getCustomerDAO();
      RoomDAO roomDAO = daoFactory.getRoomDAO();
      CreditCardDAO creditCardDAO = daoFactory.getCreditCardDAO();

      List<Order> orderList = null;
      orderList = orderDAO.list();

      Customer customer = null;
      CreditCard creditCard = null;
      Form form = null;
      Room room = null;
View Full Code Here

Examples of com.apress.prospring.ch10.data.OrderDao

    System.out.println(janm);
    System.out.println(robh);
  }
 
  private void order() {
    OrderDao orderDao = (OrderDao)context.getBean("orderDao");
    Order order = orderDao.getById(1);     
    System.out.println(order);
  }
View Full Code Here

Examples of example.dao.OrderDao

            DaoRegister<Object> register =
                MapDaoRegister.builder()
                    .put("product", new ProductDao(em))
                    .put("customer", new CustomerDao(em))
                    .put("order", new OrderDao(em))
                    .build();

            PersistenceUtil.setDAORegister(executionContext, register);

            EntityTransaction tx = em.getTransaction();
View Full Code Here

Examples of org.apache.stonehenge.stocktrader.dal.OrderDAO

        holdingID, null, quantity);
  }

  public CustomOrderBean placeOrder(String orderType, String userID,
      int holdingID, String symbol, double quantity) throws DAOException {
    OrderDAO orderDAO = factory.getOrderDAO();
    CustomOrderBean order = null;
    CustomHoldingBean holding = new CustomHoldingBean();
    try {

      orderDAO.beginTransaction();
      order = createOrder(orderType, userID, holdingID, symbol, quantity,
          holding);

      TradeOrderServiceClient asynClient = TradeOrderServiceClient.getInstance();
      asynClient.SubmitOrderTrasactedQueue(order);
      orderDAO.commitTransaction();
      return order;
    } catch (Exception e) {
      try {
        orderDAO.rollbackTransaction();
      } catch (DAOException e2) {
        throw e2;
      }
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of org.apache.stonehenge.stocktrader.dal.OrderDAO

  private CustomOrderBean createOrder(String orderType, String userID,
      int holdingID, String symbol, double quantity,
      CustomHoldingBean holding) throws DAOException {
    CustomOrderBean order = null;
    OrderDAO orderDAO = factory.getOrderDAO();

    if (StockTraderUtility.ORDER_TYPE_SELL.equals(orderType)) {
      // CHECKME holding is the argument
      holding = orderDAO.getHolding(holdingID);
      if (holding == null) {
        throw new DAOException("No holding entry found for HoldingID<"
            + holdingID + ">");
      }
      order = orderDAO.createOrder(userID, holding.getQuoteID(),
          StockTraderUtility.ORDER_TYPE_SELL, holding.getQuantity(),
          holdingID);

    } else if (StockTraderUtility.ORDER_TYPE_SELL_ENHANCED
        .equals(orderType)) {
      holding = orderDAO.getHolding(holdingID);
      if (holding == null) {
        throw new DAOException("No holding entry found for HoldingID<"
            + holdingID + ">");
      }
      if (quantity > holding.getQuantity()) {
        order = orderDAO.createOrder(userID, holding.getQuoteID(),
            StockTraderUtility.ORDER_TYPE_SELL, holding
                .getQuantity(), holdingID);
      } else {
        order = orderDAO
            .createOrder(userID, holding.getQuoteID(),
                StockTraderUtility.ORDER_TYPE_SELL, quantity,
                holdingID);
      }
    } else if (StockTraderUtility.ORDER_TYPE_BUY.equals(orderType)) {
      order = orderDAO.createOrder(userID, symbol,
          StockTraderUtility.ORDER_TYPE_BUY, quantity, -1);
    } else {
      throw new IllegalArgumentException("Invalid orderType<" + orderType
          + ">");
    }
View Full Code Here

Examples of org.apache.stonehenge.stocktrader.dal.OrderDAO

  }

  public OrderDAO getOrderDAO() throws DAOException {
    logger.debug("MSSQLDAOFactory.getOrderDAO");
    try {
      OrderDAO orderDAO = new MSSQLOrderDAO(getConnection());
      return orderDAO;
    } catch (SQLException e) {
      logger.debug("", e);
      throw new DAOException("Exception was thrown when instantiating MSSQLOrderDAO object", e);
    }
View Full Code Here

Examples of org.apache.stonehenge.stocktrader.dal.OrderDAO

  }

  public OrderDAO getOrderDAO() throws DAOException {
    logger.debug("MySQLDAOFactory.getOrderDAO");
    try {
      OrderDAO orderDAO = new MySQLOrderDAO(getConnection());
      return orderDAO;
    } catch (SQLException e) {
      logger.debug("", e);
      throw new DAOException("Exception was thrown when instantiating MySQLOrderDAO object",e);
    }
View Full Code Here

Examples of org.apache.stonehenge.stocktrader.dal.OrderDAO

  }

  public OrderDAO getOrderDAO() throws DAOException {
    logger.debug("MySQLDAOFactory.getOrderDAO");
    try {
      OrderDAO orderDAO = new MySQLOrderDAO(getConnection());
      return orderDAO;
    } catch (SQLException e) {
      logger.debug("", e);
      throw new DAOException("Exception was thrown when instantiating MySQLOrderDAO object",e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.