public ChangesStatus saveAccount(Account account,
			ArrayList<MapAccountCustomer> mapAccountCustomer) {
		Connection connection = DBConnectionHelper.getConnection();

		AccountDAO accountDAO = DAOFactory.getAccountDAO();
		MapAccountCustomerDAO mapAccountCustomerDAO = DAOFactory.getMapAccountCustomerDAO();

		try {
			if (account.getAccount_id() > 0) {
				Account _account = accountDAO.getObject(connection,
						account.getAccount_id());
				account.setAccount_type(_account.getAccount_type());
			}

			if (account.getAccount_id() > 0) {// update
				accountDAO.save(connection, account);
			} else { // insert
				accountDAO.create(connection, account);
				account.setAccount_id(accountDAO
						.getLastInsertedRowID(connection));
			}

			// Getting relations with account_id
			MapAccountCustomer mapAccountCustomerToDelete = new MapAccountCustomer();
			mapAccountCustomerToDelete.setAccount_id(account.getAccount_id());
			// loding map list to delete
			List<MapAccountCustomer> mapAccountCustomerListToDelete = mapAccountCustomerDAO
					.searchMatching(connection, mapAccountCustomerToDelete);
			// delteing
			if (mapAccountCustomerListToDelete.size() > 0) {
				for (MapAccountCustomer m : mapAccountCustomerListToDelete) {
					mapAccountCustomerDAO.delete(connection, m);
				}
			}

			// Inserting new relations
			for (MapAccountCustomer m : mapAccountCustomer) {
				MapAccountCustomer _m = new MapAccountCustomer();
				_m.setAccount_id(account.getAccount_id());
				_m.setCustomer_id(m.getCustomer_id());
				mapAccountCustomerDAO.create(connection, _m);
			}

			connection.commit();

			return new ChangesStatus(true, "Successfully updated.");
		} catch (NotFoundException e) {
			e.printStackTrace();
			return new ChangesStatus(false, "No Account ID found");
		} catch (SQLException e) {
			e.printStackTrace();
			return new ChangesStatus(false, "SQL Error. Can not be save.");
		} finally {
			try {
				connection.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}