Package org.dmlite.model.action

Examples of org.dmlite.model.action.Transaction


        if (modelConfig.isDefaultLoadSave()) {
          IDomainModel domainModel = getDomainModel();
          if (o == domainModel) {
            if (domainModel.isSession()) {
              if (arg instanceof Transaction) {
                Transaction transaction = (Transaction) arg;
                String transactionStatus = transaction
                    .getStatus();
                if (transactionStatus.equals("executed")
                    || transactionStatus.equals("undone")) {
                  List<IEntities> entries = transaction
                      .getEntries();
                  for (IEntities entry : entries) {
                    String entryCode = entry
                        .getConceptConfig()
                        .getEntitiesCode();
View Full Code Here


          IDomainModel domainModel = getDomainModel();
          if (o == domainModel) {
            if (domainModel.isSession()) {
              if (arg instanceof Transaction) {
                // domain model session transaction
                Transaction transaction = (Transaction) arg;
                String transactionStatus = transaction
                    .getStatus();
                if (transactionStatus.equals("executed")
                    || transactionStatus.equals("undone")) {
                  List<EntitiesAction> entitiesActions = transaction
                      .getEntitiesActions();
                  ObjectContainer db = getDb();
                  for (EntitiesAction action : entitiesActions) {
                    IEntities entities = action
                        .getEntities();
View Full Code Here

  private void test11() {
    try {
      boolean allActionsDone;
      Session session = getDomainModel().getSession();
      Transaction transaction = new Transaction(session);
      Comments comments = getComments();
      Comment firstComment = (Comment) comments.first();
      Comment secondComment = (Comment) comments.next(firstComment);
      EntitiesAction action1 = new RemoveAction(transaction);
      action1.setEntities(comments);
      action1.setEntity(firstComment);
      EntitiesAction action2 = new RemoveAction(transaction);
      action2.setEntities(comments);
      action2.setEntity(secondComment);
      allActionsDone = transaction.execute();
      log.info("Successful Transaction: " + allActionsDone);
    } catch (ActionException ae) {
      log.info("Transaction problem: " + ae.getMessage());
    }
  }
View Full Code Here

  private void test12() {
    try {
      boolean allActionsUndone;
      Session session = getDomainModel().getSession();
      Transaction transaction = new Transaction(session);
      Comments comments = getComments();
      Comment firstComment = (Comment) comments.first();
      Comment secondComment = (Comment) comments.next(firstComment);
      EntitiesAction action1 = new RemoveAction(transaction);
      action1.setEntities(comments);
      action1.setEntity(firstComment);
      EntitiesAction action2 = new RemoveAction(transaction);
      action2.setEntities(comments);
      action2.setEntity(secondComment);
      transaction.execute();
      allActionsUndone = transaction.undo();
      log.info("Undone Transaction: " + allActionsUndone);
    } catch (ActionException ae) {
      log.info("Transaction problem: " + ae.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.dmlite.model.action.Transaction

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.