Package dao

Examples of dao.ProductDAO


  public List<Product> getBestSellerListProduct(int soluong) {
    logger.debug("getBestSeller start");
    List<Product> Products = new ArrayList<Product>();
    Session session = HibernateUtil.getSessionFactory().openSession();
    try {
      ProductDAO spDAO = new ProductDAOImpl();
      List<Product> sps = spDAO.getListProduct();
      String hql = "";
      Query query = null;
      int[] listFrequence = new int[sps.size()];
      for (int i = 0; i < sps.size(); i++) {
        hql = " SELECT ls.count FROM Billdetail ls WHERE ls.product=:idProduct";
View Full Code Here


  // add a type to database
  public boolean addType(Type type) {
    logger.debug("addType start");
    Session session = HibernateUtil.getSessionFactory().openSession();
    ProductDAO spDAO = new ProductDAOImpl();
    if (spDAO.getInfoProduct(type.getIdtype().toString()) != null) {
      return false;
    }
    Transaction transaction = null;
    try {
      transaction = session.beginTransaction();
View Full Code Here

  //add a product to database
  public boolean addProduct(Product sp) {
    logger.debug("addproduct start");
    Session session = HibernateUtil.getSessionFactory().openSession();
    ProductDAO spDAO = new ProductDAOImpl();
    if (spDAO.getInfoProduct(sp.getIdproduct().toString()) != null) {
      return false;
    }
    Transaction transaction = null;
    try {
      transaction = session.beginTransaction();
View Full Code Here

TOP

Related Classes of dao.ProductDAO

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.