final Model m = super.entityToModel(entityType, e);
assert m != null;
final Account a = (Account) e;
if(a.getParent() != null) {
final PrimaryKey<Account> pk = new PrimaryKey<Account>(Account.class, a.getParent().getId());
final IAccountService svc = context.getEntityServiceFactory().instance(IAccountService.class);
final Account parent = svc.load(pk);
final Model mparent = new Model(TestEntityType.ACCOUNT);
mparent.set(new StringPropertyValue(Model.ID_PROPERTY, parent.getId()));
mparent.set(new StringPropertyValue(Model.NAME_PROPERTY, parent.getName()));
m.set(new RelatedOneProperty(TestEntityType.ACCOUNT, mparent, "parent", true));
}