protected Account toUnwrappedModel(Account account) { if (account instanceof AccountImpl) { return account; } AccountImpl accountImpl = new AccountImpl(); accountImpl.setNew(account.isNew()); accountImpl.setPrimaryKey(account.getPrimaryKey()); accountImpl.setAccountId(account.getAccountId()); accountImpl.setCompanyId(account.getCompanyId()); accountImpl.setUserId(account.getUserId()); accountImpl.setUserName(account.getUserName()); accountImpl.setCreateDate(account.getCreateDate()); accountImpl.setModifiedDate(account.getModifiedDate()); accountImpl.setParentAccountId(account.getParentAccountId()); accountImpl.setName(account.getName()); accountImpl.setLegalName(account.getLegalName()); accountImpl.setLegalId(account.getLegalId()); accountImpl.setLegalType(account.getLegalType()); accountImpl.setSicCode(account.getSicCode()); accountImpl.setTickerSymbol(account.getTickerSymbol()); accountImpl.setIndustry(account.getIndustry()); accountImpl.setType(account.getType()); accountImpl.setSize(account.getSize()); return accountImpl; }