Package by.bsuir.hypermarket.entity

Examples of by.bsuir.hypermarket.entity.Category


    List<Category> categories = new ArrayList<Category>();
    try (DbConnection connection = DbConnectionPool.INSTANCE.getConnection();
        PreparedStatement statement = connection.prepareStatement(SQL_FIND_ALL);
      ResultSet resultSet = statement.executeQuery()) {
      while (resultSet.next()) {
        Category category = new Category();
        fillUpCategory(resultSet, category);
        categories.add(category);
      }
    } catch (SQLException e) {
      log.error("Error during searching all entities", e);
View Full Code Here


    return categories;
  }

  @Override
  public Category findEntityById(int id) throws DaoException {
    Category category = new Category();
    try (DbConnection connection = DbConnectionPool.INSTANCE.getConnection();
        PreparedStatement idStatement = connection.prepareStatement(SQL_FIND_BY_ID)) {
      idStatement.setInt(1, id);
      ResultSet resultSet = idStatement.executeQuery();
      if (resultSet.next()) {
View Full Code Here

    try (DbConnection connection = DbConnectionPool.INSTANCE.getConnection();
        PreparedStatement idStatement = connection.prepareStatement(SQL_FIND_BY_DEPARTMENT)) {
      idStatement.setInt(1, department_uid);
      ResultSet resultSet = idStatement.executeQuery();
      while (resultSet.next()) {
        Category category = new Category();
        fillUpCategory(resultSet, category);
        categories.add(category);
      }
    } catch (SQLException e) {
      log.error("Error during statement creation or execution", e);
View Full Code Here

  }
 
  private void setDepartmentCategories(ResultSet resultSet, Department department) throws SQLException {
    List<Category> categories = new ArrayList<>();
    while (resultSet.next()) {
      Category category = new Category();
      fillUpCategory(resultSet, category);
      categories.add(category);
    }
    department.setCategories(categories);
  }
View Full Code Here

    department.setUid(resultSet.getInt("d_uid"));
    department.setName(resultSet.getString("d_name"))
    department.setPhoneNumber(resultSet.getString("d_phone_num"));
    goods.setDepartment(department);
   
    Category category = new Category();
    category.setUid(resultSet.getInt("c_uid"));
    category.setName(resultSet.getString("c_name"));
    category.setDescription(resultSet.getString("c_description"));
    goods.setCategory(category);
   
    Producer producer = new Producer();
    producer.setUid(resultSet.getInt("p_uid"));
    producer.setName(resultSet.getString("p_name"));
View Full Code Here

TOP

Related Classes of by.bsuir.hypermarket.entity.Category

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.