org.eclipse.jpt.core
Interface JpaProject

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaNode, Model

public interface JpaProject
extends JpaNode

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Nested Class Summary
static interface JpaProject.Config
          The settings used to construct a JPA project.
static interface JpaProject.Updater
          Define a strategy that can be used to "update" a JPA project whenever something changes.
 
Field Summary
static java.lang.String DISCOVERS_ANNOTATED_CLASSES_PROPERTY
          ID string used when discoversAnnotatedClasses property is changed.
static java.lang.String JPA_FILES_COLLECTION
          ID string used when jpaFiles collection is changed.
static java.lang.String USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY
          ID string used when userOverrideDefaultCatalog property is changed.
static java.lang.String USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY
          ID string used when userOverrideDefaultSchema property is changed.
 
Method Summary
 java.util.Iterator<java.lang.String> annotatedClassNames()
          Return the names of the JPA project's annotated classes.
 boolean discoversAnnotatedClasses()
          Return whether the JPA project will "discover" annotated classes automatically, as opposed to requiring the classes to be listed in persistence.xml.
 void dispose()
          The JPA project has been removed from the JPA model.
 ConnectionProfile getConnectionProfile()
          Return the project's connection.
 JpaDataSource getDataSource()
          Return the data source the JPA project is mapped to.
 java.lang.String getDefaultCatalog()
          Return the project's default catalog: - the user override catalog - the database's default catalog
 Catalog getDefaultDbCatalog()
          Return the project's default database catalog.
 Schema getDefaultDbSchema()
          Return the project's default database schema.
 SchemaContainer getDefaultDbSchemaContainer()
          Return the project's default database schema container (either the project's default catalog or the project's database).
 java.lang.String getDefaultSchema()
          Return the project's default schema: - the user override schema - the default catalog's default schema - the database's default schema
 org.eclipse.jdt.core.IJavaProject getJavaProject()
          Return the Java project associated with the JPA project.
 JavaResourcePersistentType getJavaResourcePersistentType(java.lang.String typeName)
          Return the Java resource persistent type for the specified fully qualified type name; return null, if none exists.
 JpaFile getJpaFile(org.eclipse.core.resources.IFile file)
          Return the JPA file corresponding to the specified file.
 JpaPlatform getJpaPlatform()
          Return the vendor-specific JPA platform that builds the JPA project and its contents.
 CommandExecutorProvider getModifySharedDocumentCommandExecutorProvider()
          Return the project-wide implementation of the CommandExecutorProvider interface.
 java.lang.String getName()
          Return the JPA project's name, which is the Eclipse project's name.
 org.eclipse.core.resources.IProject getProject()
          Return the Eclipse project associated with the JPA project.
 JpaRootContextNode getRootContextNode()
          Return the JpaRootContextNode representing the JPA content of this project
 java.lang.String getRootDeployLocation()
          Return the JPA project's root "deploy path".
 JpaProject.Updater getUpdater()
          Return the implementation of the Updater interface that will be used to "update" a JPA project.
 java.lang.String getUserOverrideDefaultCatalog()
          Return the name of the catalog to be used as a default for the project instead of the one that is associated by default with the connection profile.
 java.lang.String getUserOverrideDefaultSchema()
          Return the name of the schema to be used as a default for the project instead of the one that is associated by default with the connection profile.
 void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
          Forward the Java element change event to the JPA project's JPA files.
 java.util.Iterator<JpaFile> jpaFiles()
          Return the JPA project's JPA files.
 int jpaFilesSize()
          Return the size of the JPA project's JPA files.
 void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses)
          Set whether the JPA project will "discover" annotated classes automatically, as opposed to requiring the classes to be listed in persistence.xml.
 void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor)
          Set a thread-specific implementation of the CommandExecutor interface that will be used to execute a command to modify a shared document.
 void setUpdater(JpaProject.Updater updater)
          Set the implementation of the Updater interface that will be used to "update" a JPA project.
 void setUserOverrideDefaultCatalog(java.lang.String catalog)
          Set the name of the catalog to be used as a default for the project instead of the one that is associated by default with the connection profile.
 void setUserOverrideDefaultSchema(java.lang.String schema)
          Set the name of the schema to be used as a default for the project instead of the one that is associated by default with the connection profile.
 void synchronizeJpaFiles(org.eclipse.core.resources.IResourceDelta delta)
          Synchronize the JPA project's JPA files with the specified resource delta, watching for added and removed files.
 void update()
          Something in the JPA project has changed, "update" those parts of the JPA project that are dependent on other parts of the JPA project.
 org.eclipse.core.runtime.IStatus update(org.eclipse.core.runtime.IProgressMonitor monitor)
          This is the callback used by the updater to perform the actual "update".
 java.util.Iterator<org.eclipse.wst.validation.internal.provisional.core.IMessage> validationMessages()
          Return project's validation messages.
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addCollectionChangeListener, addCollectionChangeListener, addListChangeListener, addListChangeListener, addPropertyChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, addTreeChangeListener, removeCollectionChangeListener, removeCollectionChangeListener, removeListChangeListener, removeListChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 

Field Detail

USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY

static final java.lang.String USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY
ID string used when userOverrideDefaultCatalog property is changed.

See Also:
Model.addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener), Constant Field Values

USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY

static final java.lang.String USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY
ID string used when userOverrideDefaultSchema property is changed.

See Also:
Model.addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener), Constant Field Values

DISCOVERS_ANNOTATED_CLASSES_PROPERTY

static final java.lang.String DISCOVERS_ANNOTATED_CLASSES_PROPERTY
ID string used when discoversAnnotatedClasses property is changed.

See Also:
Model.addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener), Constant Field Values

JPA_FILES_COLLECTION

static final java.lang.String JPA_FILES_COLLECTION
ID string used when jpaFiles collection is changed.

See Also:
Model.addCollectionChangeListener(String, org.eclipse.jpt.utility.model.listener.CollectionChangeListener), Constant Field Values
Method Detail

getName

java.lang.String getName()
Return the JPA project's name, which is the Eclipse project's name.


getProject

org.eclipse.core.resources.IProject getProject()
Return the Eclipse project associated with the JPA project.


getJavaProject

org.eclipse.jdt.core.IJavaProject getJavaProject()
Return the Java project associated with the JPA project.


getJpaPlatform

JpaPlatform getJpaPlatform()
Return the vendor-specific JPA platform that builds the JPA project and its contents.


getDataSource

JpaDataSource getDataSource()
Return the data source the JPA project is mapped to.


getConnectionProfile

ConnectionProfile getConnectionProfile()
Return the project's connection. The connection profile is null if the connection profile name is invalid.


getDefaultDbSchemaContainer

SchemaContainer getDefaultDbSchemaContainer()
Return the project's default database schema container (either the project's default catalog or the project's database).


getDefaultCatalog

java.lang.String getDefaultCatalog()
Return the project's default catalog: - the user override catalog - the database's default catalog


getDefaultDbCatalog

Catalog getDefaultDbCatalog()
Return the project's default database catalog.

See Also:
getDefaultCatalog()

getDefaultSchema

java.lang.String getDefaultSchema()
Return the project's default schema: - the user override schema - the default catalog's default schema - the database's default schema


getDefaultDbSchema

Schema getDefaultDbSchema()
Return the project's default database schema.

See Also:
getDefaultSchema()

getUserOverrideDefaultCatalog

java.lang.String getUserOverrideDefaultCatalog()
Return the name of the catalog to be used as a default for the project instead of the one that is associated by default with the connection profile.

Returns:
The catalog name. May be null (implies that the connection profile default catalog should be used).

setUserOverrideDefaultCatalog

void setUserOverrideDefaultCatalog(java.lang.String catalog)
Set the name of the catalog to be used as a default for the project instead of the one that is associated by default with the connection profile.


getUserOverrideDefaultSchema

java.lang.String getUserOverrideDefaultSchema()
Return the name of the schema to be used as a default for the project instead of the one that is associated by default with the connection profile.

Returns:
The schema name. May be null (implies that the connection profile default schema should be used).

setUserOverrideDefaultSchema

void setUserOverrideDefaultSchema(java.lang.String schema)
Set the name of the schema to be used as a default for the project instead of the one that is associated by default with the connection profile.


discoversAnnotatedClasses

boolean discoversAnnotatedClasses()
Return whether the JPA project will "discover" annotated classes automatically, as opposed to requiring the classes to be listed in persistence.xml.


setDiscoversAnnotatedClasses

void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses)
Set whether the JPA project will "discover" annotated classes automatically, as opposed to requiring the classes to be listed in persistence.xml.


jpaFiles

java.util.Iterator<JpaFile> jpaFiles()
Return the JPA project's JPA files.


jpaFilesSize

int jpaFilesSize()
Return the size of the JPA project's JPA files.


getJpaFile

JpaFile getJpaFile(org.eclipse.core.resources.IFile file)
Return the JPA file corresponding to the specified file. Return null if unable to associate the given file with a JPA file.


getRootDeployLocation

java.lang.String getRootDeployLocation()
Return the JPA project's root "deploy path". JPA projects associated with Web projects return "WEB-INF/classes"; all others simply return an empty string.


getRootContextNode

JpaRootContextNode getRootContextNode()
Return the JpaRootContextNode representing the JPA content of this project


annotatedClassNames

java.util.Iterator<java.lang.String> annotatedClassNames()
Return the names of the JPA project's annotated classes.


getJavaResourcePersistentType

JavaResourcePersistentType getJavaResourcePersistentType(java.lang.String typeName)
Return the Java resource persistent type for the specified fully qualified type name; return null, if none exists.


synchronizeJpaFiles

void synchronizeJpaFiles(org.eclipse.core.resources.IResourceDelta delta)
                         throws org.eclipse.core.runtime.CoreException
Synchronize the JPA project's JPA files with the specified resource delta, watching for added and removed files.

Throws:
org.eclipse.core.runtime.CoreException

javaElementChanged

void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
Forward the Java element change event to the JPA project's JPA files.


dispose

void dispose()
The JPA project has been removed from the JPA model. Clean up any hooks to external resources etc.


validationMessages

java.util.Iterator<org.eclipse.wst.validation.internal.provisional.core.IMessage> validationMessages()
Return project's validation messages.


setThreadLocalModifySharedDocumentCommandExecutor

void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor)
Set a thread-specific implementation of the CommandExecutor interface that will be used to execute a command to modify a shared document. If necessary, the command executor can be cleared by setting it to null. This allows background clients to modify documents that are already present in the UI. See implementations of CommandExecutor.


getModifySharedDocumentCommandExecutorProvider

CommandExecutorProvider getModifySharedDocumentCommandExecutorProvider()
Return the project-wide implementation of the CommandExecutorProvider interface.


getUpdater

JpaProject.Updater getUpdater()
Return the implementation of the Updater interface that will be used to "update" a JPA project.


setUpdater

void setUpdater(JpaProject.Updater updater)
Set the implementation of the Updater interface that will be used to "update" a JPA project. Before setting the updater, Clients should save the current updater so it can be restored later.


update

void update()
Something in the JPA project has changed, "update" those parts of the JPA project that are dependent on other parts of the JPA project. This is called when - The JPA project updater is changed setUpdater(Updater) - anything in the JPA project changes - the JPA project's database connection is changed, opened, or closed


update

org.eclipse.core.runtime.IStatus update(org.eclipse.core.runtime.IProgressMonitor monitor)
This is the callback used by the updater to perform the actual "update".