@Override
  protected void modelToEntityReferences(
      FinancialAccountAcctDs ds, FinancialAccountAcct e, boolean isInsert) throws Exception {

    if (ds.getFinancialAccountId() != null) {
      if (e.getFinancialAccount() == null
          || !e.getFinancialAccount().getId().equals(ds.getFinancialAccountId())) {
        e.setFinancialAccount(
            (FinancialAccount) this.em.find(FinancialAccount.class, ds.getFinancialAccountId()));
      }
    } else {
      this.lookup_financialAccount_FinancialAccount(ds, e);
    }

    if (ds.getAccSchemaId() != null) {
      if (e.getAccSchema() == null || !e.getAccSchema().getId().equals(ds.getAccSchemaId())) {
        e.setAccSchema((AccSchema) this.em.find(AccSchema.class, ds.getAccSchemaId()));
      }
    } else {
      this.lookup_accSchema_AccSchema(ds, e);
    }

    if (ds.getDepositAccountId() != null) {
      if (e.getDepositAccount() == null
          || !e.getDepositAccount().getId().equals(ds.getDepositAccountId())) {
        e.setDepositAccount((Account) this.em.find(Account.class, ds.getDepositAccountId()));
      }
    } else {
      this.lookup_depositAccount_Account(ds, e);
    }

    if (ds.getWithdrawalAccountId() != null) {
      if (e.getWithdrawalAccount() == null
          || !e.getWithdrawalAccount().getId().equals(ds.getWithdrawalAccountId())) {
        e.setWithdrawalAccount((Account) this.em.find(Account.class, ds.getWithdrawalAccountId()));
      }
    } else {
      this.lookup_withdrawalAccount_Account(ds, e);
    }
  }