Package com.tll.model

Examples of com.tll.model.Account


   * Test the creation of an account history record.
   * @throws Exception
   */
  @Test
  public void testAccountHistoryRecordCreation() throws Exception {
    Account account = null;
    try {
      account = stubValidAccount(false);

      final IAccountService accountService = getEntityServiceFactory().instance(IAccountService.class);
      account = accountService.persist(account);

      getDbTrans().startTrans();
      final Criteria<AccountHistory> criteria = new Criteria<AccountHistory>(AccountHistory.class);
      criteria.getPrimaryGroup().addCriterion("account", new PrimaryKey<Account>(Account.class, account.getId()));
      final List<SearchResult<?>> list = AbstractDbAwareTest.getEntitiesFromDb(getDao(), criteria);
      getDbTrans().endTrans();
      assert list != null && list.size() == 1;
    }
    catch(final Throwable t) {
View Full Code Here


   */
  @Test
  public void testAccountHistoryListHandlerDataProvider() throws Exception {
    final IAccountService accountService = getEntityServiceFactory().instance(IAccountService.class);

    Account account = stubValidAccount(false);
    account = accountService.persist(account);

    final IListingDataProvider dataProvider = accountService.getAccountHistoryDataProvider();

    final Criteria<AccountHistory> criteria = new Criteria<AccountHistory>(AccountHistory.class);
    criteria.getPrimaryGroup().addCriterion("account", new PrimaryKey<Account>(Account.class, account.getId()));

    final Sorting sorting = new Sorting("transDate");

    final IListHandler<SearchResult<?>> lh =
      ListHandlerFactory.create(criteria, sorting, ListHandlerType.PAGE, dataProvider);
View Full Code Here

      throw new IllegalArgumentException("Unexpected invalid criteria exception occurred");
    }
    if(user == null) {
      throw new EntityNotFoundException("User with username: " + emailAddress + " was not found.");
    }
    final Account ua = user.getAccount();
    user.setAccount(ua);
    return user;
  }
View Full Code Here

    }
  }

  @Test
  public void testUserCreate() throws Exception {
    Account account = null;
    try {
      // stub the related account
      account = stubValidAccount(true);

      // stub the authorities
View Full Code Here

        // kill it
        dao.purge(entity.getPaymentInfo());
      }
    }

    final Account pe = super.persist(entity);

    // handle account history
    if(pe != null) {
      final AccountHistoryOp op = entity.isNew() ? AccountHistoryOp.ACCOUNT_ADDED : AccountHistoryOp.ACCOUNT_UPDATED;
      addHistoryRecord(new AccountHistoryContext(op, pe));
View Full Code Here

        break;
      }
      // purge account
      case ACCOUNT_PURGED: {
        // add history record to parentAccount
        final Account parent = context.getAccount().getParent();
        if(parent != null) {
          final AccountHistory ah = entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(parent), true);
          ah.setStatus(AccountStatus.DELETED);
          ah.setNotes("Child account: " + context.getAccount().typeName() + "'" + context.getAccount().descriptor()
              + "' DELETED");
View Full Code Here

  }

  @Override
  public void setAccountInterface(AccountInterface accountInterface) {

    final Account account = dao.load(new PrimaryKey<Account>(Account.class, accountInterface.getAccountId()));
    final Interface intf = dao.load(new PrimaryKey<Interface>(Interface.class, accountInterface.getInterfaceId()));

    // remove existing account subscribed options
    IBusinessKey<InterfaceOptionAccount> bk;
    try {
View Full Code Here

    if(account.getPaymentInfo() != null && account.getPaymentInfo().isNew() && account.getPersistPymntInfo()) {
      piService.persist(account.getPaymentInfo());
    }

    // create account
    final Account persistedAccount = accountService.persist(account);

    // add the account interface options
    iService.setAccountInterfaces(accountInterfaces);

    // add the users
View Full Code Here

  public void persistDependentEntities() {
    final Currency currency = createAndPersist(Currency.class, true);
    final PaymentInfo paymentInfo = createAndPersist(PaymentInfo.class, true);
    pkCurrency = new PrimaryKey<Currency>(currency);

    Account parent = create(Account.class, true);
    parent.setParent(null); // eliminate pointer chasing
    parent.setCurrency(currency);
    parent.setPaymentInfo(paymentInfo);
    parent = persist(parent);
    pkAccountParent = new PrimaryKey<Account>(parent);
    pkPaymentInfo = new PrimaryKey<PaymentInfo>(paymentInfo);
  }
View Full Code Here

TOP

Related Classes of com.tll.model.Account

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.