Class Project

java.lang.Object
org.apache.cayenne.project.Project
All Implemented Interfaces:
ProjectNode, XMLSerializable

public class Project extends Object implements ProjectNode, XMLSerializable
A Cayenne mapping project, normally loaded from XML configuration. It is the root of the project nodes tree, and contains DataMaps and the settings of a runtime DataChannel.
Since:
5.0
  • Field Details

    • SCHEMA_XSD

      public static final String SCHEMA_XSD
      The namespace in which the data map XML file will be created.
      See Also:
    • SCHEMA_XSD_LOCATION

      public static final String SCHEMA_XSD_LOCATION
      See Also:
    • name

      protected String name
    • sharedCacheEnabled

      protected boolean sharedCacheEnabled
    • validatingObjectsOnCommit

      protected boolean validatingObjectsOnCommit
    • dataMaps

      protected Collection<DataMap> dataMaps
    • configurationSource

      protected Resource configurationSource
  • Constructor Details

    • Project

      public Project()
  • Method Details

    • encodeAsXML

      public void encodeAsXML(XMLEncoder encoder, ProjectNodeVisitor<?> delegate)
      Description copied from interface: XMLSerializable
      Prints itself as XML to the provided XMLEncoder.
      Specified by:
      encodeAsXML in interface XMLSerializable
    • acceptVisitor

      public <T> T acceptVisitor(ProjectNodeVisitor<T> visitor)
      Specified by:
      acceptVisitor in interface ProjectNode
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • isSharedCacheEnabled

      public boolean isSharedCacheEnabled()
      Returns whether the object snapshots are cached in a cache shared between all ObjectContexts. True by default.
    • setSharedCacheEnabled

      public void setSharedCacheEnabled(boolean sharedCacheEnabled)
    • isValidatingObjectsOnCommit

      public boolean isValidatingObjectsOnCommit()
      Returns whether the objects are validated before they are committed. True by default.
    • setValidatingObjectsOnCommit

      public void setValidatingObjectsOnCommit(boolean validatingObjectsOnCommit)
    • getDataMaps

      public Collection<DataMap> getDataMaps()
    • getDataMap

      public DataMap getDataMap(String name)
    • getConfigurationSource

      public Resource getConfigurationSource()
    • setConfigurationSource

      public void setConfigurationSource(Resource configurationSource)