Package com.tll.model

Examples of com.tll.model.EntityCache


  @Override
  @Transactional
  public User create(Account account, String emailAddress, String password) throws ValidationException,
      EntityExistsException {
    final User user = entityAssembler.assembleEntity(User.class, new EntityCache(account));

    String encPassword = null;
    try {
      encPassword = encodePassword(password, emailAddress);
    }
View Full Code Here


  private void addHistoryRecord(final AccountHistoryContext context) {
    switch(context.getOp()) {
      // add account
      case ACCOUNT_ADDED: {
        final AccountHistory ah =
            entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getAccount()));
        ah.setNotes(context.getAccount().typeDesc() + " created");
        ah.setStatus(AccountStatus.NEW);
        dao.persist(ah);
        break;
      }
        // delete account
      case ACCOUNT_DELETED: {
        final AccountHistory ah =
            entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getAccount()));
        ah.setStatus(AccountStatus.DELETED);
        ah.setNotes(context.getAccount().typeDesc() + " marked as DELETED");
        dao.persist(ah);
        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));
          ah.setStatus(AccountStatus.DELETED);
          ah.setNotes("Child account: " + context.getAccount().typeDesc() + "'" + context.getAccount().descriptor()
              + "' DELETED");
          dao.persist(ah);
        }
View Full Code Here

    switch(context.getOp()) {

      // add customer account
      case CUSTOMER_ACCOUNT_ADDED: {
        AccountHistory ah =
            entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
                .getAccount()));
        ah.setStatus(context.getCustomerAccount().getCustomer().getStatus());
        ah.setNotes(context.getCustomerAccount().getCustomer().descriptor() + " bound");
        dao.persist(ah);

        ah =
            entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
                .getAccount()));
        ah.setStatus(context.getCustomerAccount().getAccount().getStatus());
        ah.setNotes("bound to account: " + context.getCustomerAccount().getAccount().descriptor());
        dao.persist(ah);
        break;
      }

        // purge customer account
      case CUSTOMER_ACCOUNT_PURGED: {
        AccountHistory ah =
            entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
                .getAccount()));
        ah.setStatus(context.getCustomerAccount().getCustomer().getStatus());
        ah.setNotes(context.getCustomerAccount().getCustomer().descriptor() + " un-bound (removed)");
        dao.persist(ah);

        ah =
            entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
                .getAccount()));
        ah.setStatus(context.getCustomerAccount().getAccount().getStatus());
        ah.setNotes("un-bound from account: " + context.getCustomerAccount().getAccount().descriptor());
        dao.persist(ah);
        break;
View Full Code Here

  }

  @Transactional
  public User create(Account account, String emailAddress, String password) throws ValidationException,
  EntityExistsException {
    final User user = entityAssembler.assembleEntity(User.class, new EntityCache(account), true);

    String encPassword = null;
    try {
      encPassword = encodePassword(password, emailAddress);
    }
View Full Code Here

  private void addHistoryRecord(AccountHistoryContext context) {
    switch(context.getOp()) {
      // add account
      case ACCOUNT_ADDED: {
        final AccountHistory ah =
          entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getAccount()), true);
        ah.setNotes(context.getAccount().typeName() + " created");
        ah.setStatus(AccountStatus.NEW);
        dao.persist(ah);
        break;
      }
      // delete account
      case ACCOUNT_DELETED: {
        final AccountHistory ah =
          entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getAccount()), true);
        ah.setStatus(AccountStatus.DELETED);
        ah.setNotes(context.getAccount().typeName() + " marked as DELETED");
        dao.persist(ah);
        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");
          dao.persist(ah);
        }
View Full Code Here

    switch(context.getOp()) {

      // add customer account
      case CUSTOMER_ACCOUNT_ADDED: {
        AccountHistory ah =
          entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
              .getAccount()), true);
        ah.setStatus(context.getCustomerAccount().getCustomer().getStatus());
        ah.setNotes(context.getCustomerAccount().getCustomer().descriptor() + " bound");
        dao.persist(ah);

        ah =
          entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
              .getAccount()), true);
        ah.setStatus(context.getCustomerAccount().getAccount().getStatus());
        ah.setNotes("bound to account: " + context.getCustomerAccount().getAccount().descriptor());
        dao.persist(ah);
        break;
      }

      // purge customer account
      case CUSTOMER_ACCOUNT_PURGED: {
        AccountHistory ah =
          entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
              .getAccount()), true);
        ah.setStatus(context.getCustomerAccount().getCustomer().getStatus());
        ah.setNotes(context.getCustomerAccount().getCustomer().descriptor() + " un-bound (removed)");
        dao.persist(ah);

        ah =
          entityAssembler.assembleEntity(AccountHistory.class, new EntityCache(context.getCustomerAccount()
              .getAccount()), true);
        ah.setStatus(context.getCustomerAccount().getAccount().getStatus());
        ah.setNotes("un-bound from account: " + context.getCustomerAccount().getAccount().descriptor());
        dao.persist(ah);
        break;
View Full Code Here

TOP

Related Classes of com.tll.model.EntityCache

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.