Package com.tll.model

Examples of com.tll.model.AccountInterfaceOption


   * @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);
    aio.setId(io.getId());
    aio.setVersion(Integer.valueOf(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);
      aiop.setId(iopd.getId());
      aiop.setVersion(Integer.valueOf(1))// mimic non-new entity
      aiops.add(aiop);
View Full Code Here


        ioa = dao.load(bk);
      }
      catch(final EntityNotFoundException e) {
        ioa = null;
      }
      final AccountInterfaceOption aio = generateAccountInterfaceOption(io, ioa);
      aios.add(aio);
    }

    final AccountInterface ai = entityAssembler.assembleEntity(AccountInterface.class, null);
    ai.setVersion(Integer.valueOf(1)); // mimic non-new entity
View Full Code Here

    final IEntityFactory efactory = getEntityFactory();
    final AccountInterface ai = efactory.createEntity(AccountInterface.class, true);
    ai.setAccountKey(a.getId());
    ai.setInterfaceKey(intf.getId());
    for(final InterfaceOption io : intf.getOptions()) {
      final AccountInterfaceOption aio = efactory.createEntity(AccountInterfaceOption.class, true);
      aio.setId(io.getId());
      aio.setName(io.getName());
      aio.setCode(io.getCode());
      aio.setDescription(io.getDescription());
      aio.setAnnualPrice(1f);
      aio.setMonthlyPrice(1f);
      aio.setSetUpPrice(1f);
      for(final InterfaceOptionParameterDefinition iopd : io.getParameters()) {
        final AccountInterfaceOptionParameter aiop =
          efactory.createEntity(AccountInterfaceOptionParameter.class, true);
        aiop.setId(iopd.getId());
        aiop.setName(iopd.getName());
        aiop.setCode(iopd.getCode());
        aiop.setDescription(iopd.getDescription());
        aiop.setValue(Integer.toString(RandomUtils.nextInt(100)));
        aio.addParameter(aiop);
      }
      ai.addOption(aio);
    }
    if(persist) {
      getDbTrans().startTrans();
View Full Code Here

    final IEntityFactory efactory = injector.getInstance(IEntityFactory.class);
    final AccountInterface ai = efactory.createEntity(AccountInterface.class, false);
    ai.setAccountId(a.getId());
    ai.setInterfaceId(intf.getId());
    for(final InterfaceOption io : intf.getOptions()) {
      final AccountInterfaceOption aio = efactory.createEntity(AccountInterfaceOption.class, false);
      aio.setId(io.getId());
      aio.setName(io.getName());
      aio.setCode(io.getCode());
      aio.setDescription(io.getDescription());
      aio.setAnnualPrice(1f);
      aio.setMonthlyPrice(1f);
      aio.setSetUpPrice(1f);
      for(final InterfaceOptionParameterDefinition iopd : io.getParameters()) {
        final AccountInterfaceOptionParameter aiop =
          efactory.createEntity(AccountInterfaceOptionParameter.class, false);
        aiop.setId(iopd.getId());
        aiop.setName(iopd.getName());
        aiop.setCode(iopd.getCode());
        aiop.setDescription(iopd.getDescription());
        aiop.setValue(Integer.toString(RandomUtils.nextInt(100)));
        aio.addParameter(aiop);
      }
      ai.addOption(aio);
    }
    if(persist) {
      startNewTransaction();
View Full Code Here

   * @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);
View Full Code Here

        ioa = dao.load(bk);
      }
      catch(final EntityNotFoundException e) {
        ioa = null;
      }
      final AccountInterfaceOption aio = generateAccountInterfaceOption(io, ioa);
      aios.add(aio);
    }

    final AccountInterface ai = entityAssembler.assembleEntity(AccountInterface.class, null, false);
    ai.setVersion(1); // mimic non-new entity
View Full Code Here

TOP

Related Classes of com.tll.model.AccountInterfaceOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.