public void doPersistDependentEntities() {
Currency currency = create(Currency.class, true);
currency = persist(currency);
pkCurrency = currency.getId();
NestedEntity nestedEntity = create(NestedEntity.class, true);
nestedEntity = persist(nestedEntity);
pkNestedEntity = nestedEntity.getId();
Account parent = create(Account.class, true);
parent.setName("parent account");
parent.setParent(null); // eliminate pointer chasing
parent.setCurrency(currency);