Updates the path_order column in the table, loops though the pathOrder array, and changes the value to the loop
index+1 for the specified pathId

@param profileId ID of profile
@param pathOrder array containing new order of paths
977521
public void updatePathOrder(int profileId, int[] pathOrder) {
        for (int i = 0; i < pathOrder.length; i++) {
            EditService.updatePathTable(Constants.PATH_PROFILE_PATH_ORDER, (i + 1), pathOrder[i]);
        }
    }
895486
@RequestMapping(path="/{orderId}/status", method = RequestMethod.PUT)
    public ResponseEntity<Order> updateStatus(@PathVariable("orderId") Long orderId, @RequestParam("status") OrderStatus status){
        Order order = orderService.updateStatus(orderId, status);
        if(order != null){
            return new ResponseEntity<Order>(order, HttpStatus.OK);
        }
        return new ResponseEntity<Order>(HttpStatus.NOT_FOUND);
    }
115483
public <F> void updateProfileField(ProfileField<F, ?> field, F value) {
		if (field.isSingle()) {
			getResourceFactory()
					.getApiResource("/user/profile/" + field.getName())
					.entity(new ProfileFieldSingleValue<F>(value),
							MediaType.APPLICATION_JSON_TYPE).put();
		} else {
			getResourceFactory()
					.getApiResource("/user/profile/" + field.getName())
					.entity(new ProfileFieldMultiValue<F>(value),
							MediaType.APPLICATION_JSON_TYPE).put();
		}
	}
559599
public void setResponseEnabled(int pathId, boolean enabled, String clientUUID) throws Exception {
        PreparedStatement statement = null;
        int profileId = EditService.getProfileIdFromPathID(pathId);
        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "UPDATE " + Constants.DB_TABLE_REQUEST_RESPONSE +
                    " SET " + Constants.DB_TABLE_PATH_RESPONSE_ENABLED + "= ?" +
                    " WHERE " + Constants.GENERIC_PROFILE_ID + "= ?" +
                    " AND " + Constants.GENERIC_CLIENT_UUID + "= ?" +
                    " AND " + Constants.REQUEST_RESPONSE_PATH_ID + "= ?"
            );
            statement.setBoolean(1, enabled);
            statement.setInt(2, profileId);
            statement.setString(3, clientUUID);
            statement.setInt(4, pathId);
            statement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
897631
public void enableOverride(int overrideId, int pathId, String clientUUID) throws Exception {
        // get profileId from pathId
        int profileId = PathOverrideService.getInstance().getPath(pathId).getProfileId();
        int newPriority = 0;

        // we want to limit -1, -2 to only be added once since they are the Custom responses/requests
        if (overrideId == Constants.PLUGIN_REQUEST_OVERRIDE_CUSTOM) {
            if (this.getEnabledEndpoint(pathId, overrideId, null, clientUUID) != null) {
                return;
            }
        }

        // need to first determine the highest enabled order value for this path
        HashMap<String, Object> priorities = sqlService.getFirstResult(
            "SELECT * FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
                " WHERE " + Constants.REQUEST_RESPONSE_PATH_ID + "=" + pathId +
                " AND " + Constants.GENERIC_CLIENT_UUID + "='" + clientUUID +
                "' ORDER BY + " + Constants.ENABLED_OVERRIDES_PRIORITY + " DESC"
        );
        if (priorities != null) {
            newPriority = Integer.valueOf(priorities.get(Constants.ENABLED_OVERRIDES_PRIORITY.toUpperCase()).toString()) + 1;
        }

        PreparedStatement statement = null;
        try (Connection sqlConnection = sqlService.getConnection()) {

            PreparedStatement query = null;
            ResultSet results = null;
            SQLService sqlService = SQLService.getInstance();
            com.groupon.odo.proxylib.models.Method method = null;
            query = sqlConnection.prepareStatement(
                "SELECT * FROM " + Constants.DB_TABLE_OVERRIDE +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            query.setString(1, String.valueOf(overrideId));
            results = query.executeQuery();
            JSONSerializer serializer = new JSONSerializer();
            if (results.next()) {
                String className = results.getString(Constants.OVERRIDE_CLASS_NAME);
                String methodName = results.getString(Constants.OVERRIDE_METHOD_NAME);
                method = PluginManager.getInstance().getMethod(className, methodName);
            }

            statement = sqlConnection.prepareStatement(
                "INSERT INTO " + Constants.DB_TABLE_ENABLED_OVERRIDE +
                    "(" + Constants.GENERIC_PROFILE_ID + "," + Constants.GENERIC_CLIENT_UUID + "," +
                    Constants.REQUEST_RESPONSE_PATH_ID + "," + Constants.ENABLED_OVERRIDES_OVERRIDE_ID + "," +
                    Constants.ENABLED_OVERRIDES_PRIORITY + "," + Constants.ENABLED_OVERRIDES_ARGUMENTS +  "," +
                    Constants.ENABLED_OVERRIDES_RESPONSE_CODE + ")" +
                    " VALUES (?, ?, ?, ?, ?, ?, ?);"
            );
            statement.setInt(1, profileId);
            statement.setString(2, clientUUID);
            statement.setInt(3, pathId);
            statement.setInt(4, overrideId);
            statement.setInt(5, newPriority);
            if (method == null) {
                statement.setString(6, "");
            } else {
                ArrayList<String> argDefaults = new ArrayList<String>();
                for (int i = 0; i < method.getMethodArguments().length; i++) {
                    if (i < method.getMethodDefaultArguments().length && method.getMethodDefaultArguments()[i] != null) {
                        argDefaults.add(String.valueOf(method.getMethodDefaultArguments()[i]));
                    } else {
                        argDefaults.add("");
                    }
                }
                statement.setString(6, serializer.serialize(argDefaults));
            }
            statement.setString(7,"200");
            statement.executeUpdate();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
1275803
public void updateProfile(ProfileFieldValues values) {
		getResourceFactory().getApiResource("/user/profile/")
				.entity(values, MediaType.APPLICATION_JSON_TYPE).put();
	}
1290766
public static boolean setCustomResponseForDefaultProfile(String pathName, String customData) {
        try {
            return setCustomForDefaultProfile(pathName, true, customData);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
513683
public <F> void updateProfileField(ProfileField<F, ?> field, List<F> values) {
		if (field.isSingle()) {
			throw new IllegalArgumentException(
					"Field is only valid for single value");
		} else {
			getResourceFactory()
					.getApiResource("/user/profile/" + field.getName())
					.entity(new ProfileFieldMultiValue<F>(values),
							MediaType.APPLICATION_JSON_TYPE).put();
		}
	}
1087160
private function updateNavigationListOrder($id, $listOrder, $parentId = 0)
    {
        $row = Page::find($id);
        $row->parent_id = $parentId;
        //if ($row->url_parent_id != 0) {
            // update the url parent id as well
            $row->url_parent_id = $parentId;
        //}

        $row->updateUrl();
        $row[$this->orderProperty] = $listOrder;
        $row->save();

        return $row;
    }
917517
public void updateRepeatNumber(int newNum, int path_id, String client_uuid) throws Exception {
        updateRequestResponseTables("repeat_number", newNum, getProfileIdFromPathID(path_id), client_uuid, path_id);
    }
1156940
public void removePathnameFromProfile(int path_id, int profileId) {
        PreparedStatement statement = null;
        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
                    " WHERE " + Constants.ENABLED_OVERRIDES_PATH_ID + " = ?"
            );
            statement.setInt(1, path_id);
            statement.executeUpdate();
            statement.close();

            statement = sqlConnection.prepareStatement(
                "DELETE FROM " + Constants.DB_TABLE_PATH +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            statement.setInt(1, path_id);
            statement.executeUpdate();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
325961
private void updateBranch(int leafOrder) {
        int nodeOrder = MerkleTreeUtil.getParentOrder(leafOrder);

        for (int level = leafLevel; level > 0; level--) {
            int leftChildOrder = MerkleTreeUtil.getLeftChildOrder(nodeOrder);
            int rightChildOrder = MerkleTreeUtil.getRightChildOrder(nodeOrder);

            int leftChildHash = getNodeHash(leftChildOrder);
            int rightChildHash = getNodeHash(rightChildOrder);

            int newNodeHash = MerkleTreeUtil.sumHash(leftChildHash, rightChildHash);
            setNodeHash(nodeOrder, newNodeHash);

            nodeOrder = MerkleTreeUtil.getParentOrder(nodeOrder);
        }
    }
559767
public int addPathnameToProfile(int id, String pathname, String actualPath) throws Exception {
        int pathOrder = getPathOrder(id).size() + 1;
        int pathId = -1;
        PreparedStatement statement = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "INSERT INTO " + Constants.DB_TABLE_PATH
                    + "(" + Constants.PATH_PROFILE_PATHNAME + ","
                    + Constants.PATH_PROFILE_ACTUAL_PATH + ","
                    + Constants.PATH_PROFILE_GROUP_IDS + ","
                    + Constants.PATH_PROFILE_PROFILE_ID + ","
                    + Constants.PATH_PROFILE_PATH_ORDER + ","
                    + Constants.PATH_PROFILE_CONTENT_TYPE + ","
                    + Constants.PATH_PROFILE_REQUEST_TYPE + ","
                    + Constants.PATH_PROFILE_GLOBAL + ")"
                    + " VALUES (?, ?, ?, ?, ?, ?, ?, ?);",
                PreparedStatement.RETURN_GENERATED_KEYS
            );
            statement.setString(1, pathname);
            statement.setString(2, actualPath);
            statement.setString(3, "");
            statement.setInt(4, id);
            statement.setInt(5, pathOrder);
            statement.setString(6, Constants.PATH_PROFILE_DEFAULT_CONTENT_TYPE); // should be set by UI/API
            statement.setInt(7, Constants.REQUEST_TYPE_GET); // should be set by UI/API
            statement.setBoolean(8, false);
            statement.executeUpdate();

            // execute statement and get resultSet which will have the generated path ID as the first field
            results = statement.getGeneratedKeys();

            if (results.next()) {
                pathId = results.getInt(1);
            } else {
                // something went wrong
                throw new Exception("Could not add path");
            }
        } catch (SQLException e) {
            throw e;
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }

        // need to add to request response table for all clients
        for (Client client : ClientService.getInstance().findAllClients(id)) {
            this.addPathToRequestResponseTable(id, client.getUUID(), pathId);
        }

        return pathId;
    }
64183
public void addProfile(Profile profile) {
        if (PROFILE_KIND.equals(profile.getKind())) {
            this.profileList.add(profile.getSettings());
        }
    }
1178002
public static int getProfileIdFromPathID(int path_id) throws Exception {
        return (Integer) SQLService.getInstance().getFromTable(Constants.GENERIC_PROFILE_ID, Constants.GENERIC_ID, path_id, Constants.DB_TABLE_PATH);
    }
992372
public void addProfile(@NonNull IProfile profile, int position) {
        if (mAccountHeaderBuilder.mProfiles == null) {
            mAccountHeaderBuilder.mProfiles = new ArrayList<>();
        }
        mAccountHeaderBuilder.mProfiles.add(position, profile);

        mAccountHeaderBuilder.updateHeaderAndList();
    }
49032
public String getGroupIdsInPathProfile(int profileId, int pathId) {
        return (String) sqlService.getFromTable(Constants.PATH_PROFILE_GROUP_IDS, Constants.GENERIC_ID, pathId,
                                                Constants.DB_TABLE_PATH);
    }