public static HistoryDTO transformToDto ( History history ) { if ( history == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } HistoryDTO historyDto = new HistoryDTO ( ) ; try { BeanUtils . copyProperties ( historyDto , history ) ; } catch ( Exception ex ) { throw new WebApplicationException ( "DTO transformation failed." , Status . INTERNAL_SERVER_ERROR ) ; } return historyDto ; }
Converts a history object to DTO .