Package org.dmlite.model

Examples of org.dmlite.model.DomainModel


   *            specific model configuration file path
   */
  public PersistentModel(String modelCode, String dmLiteModelConfigFilePath,
      String reusableModelConfigFilePath,
      String specificModelConfigFilePath) {
    domainModel = new DomainModel(modelCode, dmLiteModelConfigFilePath,
        reusableModelConfigFilePath, specificModelConfigFilePath);
    DomainModel dm = (DomainModel) domainModel;
    dm.addObserver(this);
    ModelConfig modelConfig = domainModel.getModelConfig();
    if (modelConfig.isPersistent()) {
      createPersistentEntries();
    }
  }
View Full Code Here


      throw new ActionException(e.getMessage(), this);
    }
    if (executed) {
      setStatus("executed");
      if (getTransaction() == null) {
        DomainModel domainModel = (DomainModel) getSession()
            .getDomainModel();
        domainModel.notifyObservers(this);
      }
    }
    return executed;
  }
View Full Code Here

      throw new ActionException(e.getMessage(), this);
    }
    if (undone) {
      setStatus("undone");
      if (getTransaction() == null) {
        DomainModel domainModel = (DomainModel) getSession()
            .getDomainModel();
        domainModel.notifyObservers(this);
      }
    }
    return undone;
  }
View Full Code Here

   * Executes the transaction.
   *
   * @return <code>true</code> if executed
   */
  public boolean execute() throws ActionException {
    DomainModel domainModel = (DomainModel) getSession().getDomainModel();
    if (!domainModel.isSession()) {
      String error = "The domain model is not configured for transactions.";
      throw new ActionException(error, this);
    } else if (getSession() == null) {
      String error = "Transaction must be within a session.";
      throw new ActionException(error, this);
    }
    boolean executed = actions.executeAll();
    if (executed) {
      setStatus("executed");
      domainModel.notifyObservers(this);
    } else {
      actions.undoAll();
    }
    return executed;
  }
View Full Code Here

      throw new ActionException(error, this);
    }
    boolean undone = actions.undoAll();
    if (undone) {
      setStatus("undone");
      DomainModel domainModel = (DomainModel) getSession()
          .getDomainModel();
      domainModel.notifyObservers(this);
    } else {
      actions.executeAll();
    }
    return undone;
  }
View Full Code Here

   * @param modelCode
   *            model code
   */
  public ModelContext(String modelCode) {
    super();
    domainModel = new DomainModel(modelCode,
        getDmLiteModelConfigFilePath(),
        getReusableModelConfigFilePath(),
        getSpecificModelConfigFilePath());
  }
View Full Code Here

TOP

Related Classes of org.dmlite.model.DomainModel

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.