@Override
	public CategoryModel searchCategoryByName(String name)
			throws WebshopAppException {
		if (name != null) {
			try (Connection conn = getConnection()) {

				String sql = "SELECT id, name, staff_responsible "
						+ "FROM categories WHERE name = ?";

				try (PreparedStatement pstmt = conn.prepareStatement(sql)) {
					setString(pstmt, 1, name);

					try (ResultSet rs = pstmt.executeQuery()) {

						CategoryModel model = null;
						if (rs.next()) {
							model = parseResultSetToModel(rs);

							Log.logOut(LOGGER, this, "SEARCH_CATEGORY_BY_NAME",
									"Category searched by name: ",
									model.toString());
						}
						return model;
					}
				}

			} catch (SQLException e) {
				WebshopAppException excep = new WebshopAppException(e, this
						.getClass().getSimpleName(), "SEARCH_CATEGORY_BY_NAME");

				Log.logOutWAException(LOGGER, excep);

				throw excep;
			}
		}

		return null;
	}