* @param io The required interface option
* @param ioa The optional {@link InterfaceOptionAccount}
*/
private AccountInterfaceOption generateAccountInterfaceOption(InterfaceOption io, InterfaceOptionAccount ioa) {
assert io != null;
final AccountInterfaceOption aio = entityAssembler.assembleEntity(AccountInterfaceOption.class, null, false);
aio.setId(io.getId());
aio.setVersion(1); // mimic non-new entity
aio.setAnnualCost(io.getAnnualCost());
aio.setAnnualPrice(io.getBaseAnnualPrice());
aio.setBaseAnnualPrice(io.getBaseAnnualPrice());
aio.setBaseMonthlyPrice(io.getBaseMonthlyPrice());
aio.setBaseSetupPrice(io.getBaseSetupPrice());
aio.setCode(io.getCode());
aio.setDateCreated(io.getDateCreated());
aio.setDateModified(io.getDateModified());
aio.setDefault(io.isDefault());
aio.setDescription(io.getDescription());
aio.setMonthlyCost(io.getMonthlyCost());
aio.setName(io.getName());
aio.setSetUpCost(io.getSetUpCost());
aio.setSubscribed(ioa != null); // account is subscribed simply if there is a InterfaceOptionAccount record
final LinkedHashSet<AccountInterfaceOptionParameter> aiops = new LinkedHashSet<AccountInterfaceOptionParameter>();
aio.setParameters(aiops);
for(final InterfaceOptionParameterDefinition iopd : io.getParameters()) {
final AccountInterfaceOptionParameter aiop = entityAssembler.assembleEntity(AccountInterfaceOptionParameter.class, null, false);
aiop.setId(iopd.getId());
aiop.setVersion(1); // mimic non-new entity
aiops.add(aiop);