Package org.dmlite.model.action

Examples of org.dmlite.model.action.RemoveAction


  private void test09() {
    try {
      boolean done;
      Session session = getDomainModel().getSession();
      EntitiesAction action = new RemoveAction(session);
      Comments comments = getComments();
      Comment firstComment = (Comment) comments.first();
      action.setEntities(comments);
      action.setEntity(firstComment);
      done = action.execute();
      log.info("Successful Action: " + done);
    } catch (ActionException ae) {
      log.info("Action problem: " + ae.getMessage());
    }
  }
View Full Code Here


  private void test10() {
    try {
      boolean undone;
      Session session = getDomainModel().getSession();
      EntitiesAction action = new RemoveAction(session);
      Comments comments = getComments();
      Comment firstComment = (Comment) comments.first();
      action.setEntities(comments);
      action.setEntity(firstComment);
      action.execute();
      undone = action.undo();
      log.info("Undone Action: " + undone);
    } catch (ActionException ae) {
      log.info("Action problem: " + ae.getMessage());
    }
  }
View Full Code Here

      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

      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

   * @return <code>true</code> if the entity is removed
   * @throws dmLite
   *             action exception if there is a problem
   */
  public boolean remove(T entity) throws ActionException {
    EntitiesAction entitiesRemoveAction = new RemoveAction();
    entitiesRemoveAction.setEntities(this);
    entitiesRemoveAction.setEntity(entity);
    try {
      if (!preRemove(entity)) {
        return false;
      }

View Full Code Here

TOP

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

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.