Class UpgradeContext

java.lang.Object
org.apache.cayenne.project.upgrade.UpgradeContext

public class UpgradeContext extends Object
A context for an XML document of a project or a DataMap being upgraded.
Since:
4.1
  • Constructor Details

  • Method Details

    • getDocument

      public Document getDocument()
    • getDocumentIfLossless

      public Document getDocumentIfLossless()
      Returns the upgraded document if the upgrade was lossless, i.e. made no changes that may affect runtime. Such a document can be loaded as is, without saving it or involving the user.
      Throws:
      ConfigurationException - if the upgrade was not lossless, and so requires the project to be upgraded in CayenneModeler
      Since:
      5.0
    • getSource

      public Resource getSource()
      Since:
      5.0
    • recordChange

      public void recordChange(String message, boolean mayAffectRuntime)
      Records a message about manual steps that the user needs to take after the upgrade.
      Since:
      5.0
    • getChangeNotifications

      public List<String> getChangeNotifications()
      Since:
      5.0
    • getChangesAffectingRuntime

      public List<String> getChangesAffectingRuntime()
      Since:
      5.0
    • addObsoleteFile

      public void addObsoleteFile(String relativePath)
      Records a file that the upgraded document no longer references, as a path relative to the document's own location. A caller that saves the upgraded document may delete it.
      Since:
      5.0
    • getObsoleteFiles

      public List<String> getObsoleteFiles()
      Since:
      5.0