question: @ RequestMapping ( value = { "/" , "" } , method = RequestMethod . PUT ) @ ResponseBody public RestWrapper insert ( @ ModelAttribute ( "users" ) @ Valid Users users , BindingResult bindingResult , Principal principal ) { RestWrapper restWrapper = null ; if ( bindingResult . hasErrors ( ) ) { BindingResultError bindingResultError = new BindingResultError ( ) ; return bindingResultError . errorMessage ( bindingResult ) ; } try { String hashedPassword = DigestUtils . sha1Hex ( users . getPassword ( ) ) ; com . wipro . ats . bdre . md . dao . jpa . Users jpaUsers = new com . wipro . ats . bdre . md . dao . jpa . Users ( ) ; jpaUsers . setPassword ( hashedPassword ) ; jpaUsers . setUsername ( users . getUsername ( ) ) ; jpaUsers . setEnabled ( ( users . getEnabled ( ) == 1 ) ? true : false ) ; usersDAO . insert ( jpaUsers ) ; restWrapper = new RestWrapper ( users , RestWrapper . OK ) ; LOGGER . info ( "Record with ID:" + users . getUsername ( ) + " inserted in Users by User:" + principal . getName ( ) + users ) ; } catch ( Exception e ) { LOGGER . error ( e ) ; restWrapper = new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
target:  This method calls InsertUsers and adds a record passed in Users table. It also validates the values passed.