public JpaPageUser convert(PageUser source) {
return source instanceof JpaPageUser ? (JpaPageUser) source : createEntity(source);
}
private JpaPageUser createEntity(PageUser source) {
JpaPageUser converted = null;
if (source != null) {
converted = source.getId() == null ? new JpaPageUser() : manager.find(JpaPageUser.class, Long.parseLong(source.getId())); if(converted == null) {
converted = new JpaPageUser();
}
updateProperties(source, converted);
}
return converted;
}