Created
November 1, 2011 15:35
-
-
Save theresajayne/1330841 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package uk.co.inbrand.service.impl; | |
import uk.co.inbrand.dao.UserRolesDao; | |
import uk.co.inbrand.dto.UserRolesBase; | |
import uk.co.inbrand.model.UserRoles; | |
/** | |
* | |
* @author Thersa Jayne Forster | |
*/ | |
public class UserRolesAssembler { | |
private UserRolesDao userRolesDao; | |
public UserRolesAssembler(UserRolesDao userRolesDao) { | |
this.userRolesDao = userRolesDao; | |
} | |
public void populateDomainFromBase(UserRoles domain, UserRolesBase dto) { | |
UserRoles domaintest = userRolesDao.getRecordById(dto.getId()); | |
if (domaintest!=null) { | |
domain = domaintest; | |
} | |
domain.setId(dto.getId()); | |
domain.setDescription(dto.getDescription()); | |
domain.setRole_code(dto.getRole_code()); | |
domain.setRole_value(dto.getRole_value()); | |
} | |
public void extractBaseFromDomain(UserRoles domain, UserRolesBase dto) { | |
dto.setId(domain.getId()); | |
dto.setRole_code(domain.getRole_code()); | |
dto.setDescription(domain.getDescription()); | |
dto.setRole_value(domain.getRole_value()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment