Package com.tll.model

Examples of com.tll.model.InterfaceOptionAccount


    bk.setPropertyValue("account.id", accountKey);

    final Interface intf = dao.load(Interface.class, interfaceKey);

    final LinkedHashSet<AccountInterfaceOption> aios = new LinkedHashSet<AccountInterfaceOption>();
    InterfaceOptionAccount ioa;
    for(final InterfaceOption io : intf.getOptions()) {
      bk.setPropertyValue("option.id", io.getId());
      try {
        ioa = dao.load(bk);
      }
View Full Code Here


    bk.setPropertyValue("account.id", accountInterface.getAccountKey());

    for(final InterfaceOption io : intf.getOptions()) {
      try {
        bk.setPropertyValue("option.id", io.getId());
        final InterfaceOptionAccount ioa = dao.load(bk);
        dao.purge(ioa);
      }
      catch(final EntityNotFoundException e) {
        // ok
      }
    }

    // add the replacement ioas
    for(final AccountInterfaceOption aio : accountInterface.getOptions()) {
      final InterfaceOptionAccount ioa = entityAssembler.assembleEntity(InterfaceOptionAccount.class, null);
      ioa.setAccount(account);
      final InterfaceOption io = dao.load(InterfaceOption.class, aio.getId());
      ioa.setOption(io);
      ioa.setSetUpPrice(aio.getSetUpPrice());
      ioa.setMonthlyPrice(aio.getMonthlyPrice());
      ioa.setAnnualPrice(aio.getAnnualPrice());

      final HashMap<String, String> mparams = new HashMap<String, String>();
      for(final AccountInterfaceOptionParameter aiop : aio.getParameters()) {
        mparams.put(aiop.getName(), aiop.getValue());
      }
      ioa.setParameters(mparams);

      dao.persist(ioa);
    }

  }
View Full Code Here

    BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
    final IBusinessKey<InterfaceOptionAccount> bk = bkf.create(InterfaceOptionAccount.class, "Option Id and Account Id");
    bk.setPropertyValue("option.id", io.getId());
    bk.setPropertyValue("account.id", a.getId());
    final InterfaceOptionAccount ioa = getDao().load(bk);
    Assert.assertNotNull(ioa);
  }
View Full Code Here

    Assert.assertNotNull(ai);
  }

  public void testPurgeAccountInterface() throws Exception {
    final Interface intf = stubInterface(true);
    InterfaceOptionAccount ioa = stubIoa(intf, true);

    getInterfaceService().purgeAccountInterface(ioa.accountKey(), intf.getId());

    try {
      ioa = getDao().load(InterfaceOptionAccount.class, ioa.getId());
      Assert.fail("Not purged: " + ioa);
    }
    catch(final EntityNotFoundException e) {
      // expected
    }
View Full Code Here

  }

  private InterfaceOptionAccount stubIoa(Interface intf, boolean persist) {
    if(persist) getDbTrans().startTrans();
    final Account a = stub(Asp.class, false);
    final InterfaceOptionAccount ioa = stub(InterfaceOptionAccount.class, false);
    ioa.setAccount(a);
    ioa.setOption(intf.getOptions().iterator().next());
    if(persist) {
      getDbTrans().setComplete();
      getDao().persist(intf);
      getDbTrans().endTrans();
    }
View Full Code Here

    bk.setPropertyValue("account.id", accountKey);

    for(final InterfaceOption io : intf.getOptions()) {
      bk.setPropertyValue("option.id", io.getId());
      try {
        final InterfaceOptionAccount ioa = dao.load(bk);
        dao.purge(ioa);
      }
      catch(final EntityNotFoundException e) {
        // ok
      }
View Full Code Here

    getInterfaceService().setAccountInterface(ai);

    final IBusinessKey<InterfaceOptionAccount> bk = BusinessKeyFactory.create(InterfaceOptionAccount.class, "Option Id and Account Id");
    bk.setPropertyValue("option.id", io.getId());
    bk.setPropertyValue("account.id", a.getId());
    final InterfaceOptionAccount ioa = getDao().load(bk);
    Assert.assertNotNull(ioa);
  }
View Full Code Here

    Assert.assertNotNull(ai);
  }

  public void testPurgeAccountInterface() throws Exception {
    final Interface intf = stubInterface(true);
    InterfaceOptionAccount ioa = stubIoa(intf, true);

    getInterfaceService().purgeAccountInterface(ioa.accountId(), intf.getId());

    try {
      ioa = getDao().load(new PrimaryKey<InterfaceOptionAccount>(InterfaceOptionAccount.class, ioa.getId()));
      Assert.fail("Not purged: " + ioa);
    }
    catch(final EntityNotFoundException e) {
      // expected
    }
View Full Code Here

  }

  private InterfaceOptionAccount stubIoa(Interface intf, boolean persist) {
    if(persist) startNewTransaction();
    final Account a = stub(Asp.class, false);
    final InterfaceOptionAccount ioa = stub(InterfaceOptionAccount.class, false);
    ioa.setAccount(a);
    ioa.setOption(intf.getOptions().iterator().next());
    if(persist) {
      setComplete();
      getDao().persist(intf);
      endTransaction();
    }
View Full Code Here

    bk.setPropertyValue("account.id", accountId);

    final Interface intf = dao.load(new PrimaryKey<Interface>(Interface.class, interfaceId));

    final LinkedHashSet<AccountInterfaceOption> aios = new LinkedHashSet<AccountInterfaceOption>();
    InterfaceOptionAccount ioa;
    for(final InterfaceOption io : intf.getOptions()) {
      bk.setPropertyValue("option.id", io.getId());
      try {
        ioa = dao.load(bk);
      }
View Full Code Here

TOP

Related Classes of com.tll.model.InterfaceOptionAccount

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.