OccupationController.java
@PutMapping("/{id}")
	@ApiOperation(value = "Updates a user specified occupation at the id passed", response = Occupation.class)
	@ApiResponses(value = {
			@ApiResponse(code = 200, message = "The updated occupation"),
			@ApiResponse(code = 400, message = "Occupatiom already exists"),
			@ApiResponse(code = 404, message = "Occupation not found"),
			@ApiResponse(code = 500, message = "Backend error")})
	public ResponseEntity updateOccupation(@PathVariable int id, @RequestBody Occupation occupation) {
		try {
			Occupation updatedOccupation = occupationHelper.update(conn, id, occupation); //Updates an occupation at the given id
			if(updatedOccupation.equals(occupation)) { //Makes sure the user passed occupation and the returned occupation are the same
				return new ResponseEntity<Occupation>(updatedOccupation, HttpStatus.OK); //Returns the updated occupation
			}else {
				throw new AddressException(HttpStatus.NOT_FOUND, bundle.getString("occupation_not_found"));
			}
		}catch(AddressException e) {
			e.printStackTrace();
			return new ResponseEntity<String>(e.getMessage(), e.getHttp());
		}
	}
/**
	 * Updates a user specified occupation at the id passed
	 * @param id ID of the occupation to be updated
	 * @param occupation The new occupation to update the current occupation
	 * @return An occupation object
	 */
Updates a user specified occupation at the id passed
@param id ID of the occupation to be updated
@param occupation The new occupation to update the current occupation
@return An occupation object
Updates a user specified occupation at the id passed @param id ID of the occupation to be updated @param occupation The new occupation to update the current occupation @return An occupation object
@PutMapping("/{id}")
	@ApiOperation(value = "Updates a user specified occupation at the id passed", response = Occupation.class)
	@ApiResponses(value = {
			@ApiResponse(code = 200, message = "The updated occupation"),
			@ApiResponse(code = 400, message = "Occupatiom already exists"),
			@ApiResponse(code = 404, message = "Occupation not found"),
			@ApiResponse(code = 500, message = "Backend error")})
	public ResponseEntity updateOccupation(@PathVariable int id, @RequestBody Occupation occupation) {
		try {
			Occupation updatedOccupation = occupationHelper.update(conn, id, occupation); 
			if(updatedOccupation.equals(occupation)) { 
				return new ResponseEntity<Occupation>(updatedOccupation, HttpStatus.OK); 
			}else {
				throw new AddressException(HttpStatus.NOT_FOUND, bundle.getString("occupation_not_found"));
			}
		}catch(AddressException e) {
			e.printStackTrace();
			return new ResponseEntity<String>(e.getMessage(), e.getHttp());
		}
	}
@ PutMapping ( "/{id}" ) @ ApiOperation ( value = "Updates a user specified occupation at the id passed" , response = Occupation . class ) @ ApiResponses ( value = { @ ApiResponse ( code = 200 , message = "The updated occupation" ) , @ ApiResponse ( code = 400 , message = "Occupatiom already exists" ) , @ ApiResponse ( code = 404 , message = "Occupation not found" ) , @ ApiResponse ( code = 500 , message = "Backend error" ) } ) public ResponseEntity updateOccupation ( @ PathVariable int id , @ RequestBody Occupation occupation ) { try { Occupation updatedOccupation = occupationHelper . update ( conn , id , occupation ) ; if ( updatedOccupation . equals ( occupation ) ) { return new ResponseEntity < Occupation > ( updatedOccupation , HttpStatus . OK ) ; } else { throw new AddressException ( HttpStatus . NOT_FOUND , bundle . getString ( "occupation_not_found" ) ) ; } } catch ( AddressException e ) { e . printStackTrace ( ) ; return new ResponseEntity < String > ( e . getMessage ( ) , e . getHttp ( ) ) ; } }
Updates a user specified occupation at the id passed
 @param id ID of the occupation to be updated
 @param occupation The new occupation to update the current occupation
 @return An occupation object
Updates a user specified occupation at the id passed @param id ID of the occupation to be updated @param occupation The new occupation to update the current occupation @return An occupation object
//Updates an occupation at the given id //Makes sure the user passed occupation and the returned occupation are the same //Returns the updated occupation