org.eclipse.jpt.jpa.core
Interface JpaPlatform


public interface JpaPlatform

This interface is to be implemented by a JPA vendor to provide extensions to the core JPA model. The core JPA model will provide functionality for JPA spec annotations in Java, persistence.xml and mapping (orm.xml) files. The org.eclipse.jpt.jpa.core.generic extension supplies resource models for those file types. As another vendor option you will have to supply those resource models as well or different ones as necessary. In the extension point you actually provide a JpaPlatformFactory that will build the JPA platform.

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.

See the org.eclipse.jpt.jpa.core.jpaPlatforms extension point.

Since:
2.0
Version:
3.0
See Also:
JpaPlatformFactory, JpaPlatformProvider

Nested Class Summary
static interface JpaPlatform.Version
           
 
Method Summary
 JpaFile buildJpaFile(JpaProject jpaProject, org.eclipse.core.resources.IFile file)
          Return a JPA file corresponding to the specified Eclipse file.
 AnnotationEditFormatter getAnnotationEditFormatter()
          Return a formatter that can clean up the Java annotations added to source code.
 JpaAnnotationProvider getAnnotationProvider()
          Return an annotation provider responsible for determining what Java annotations are supported and constructing java resource model objects.
 ConnectionProfileFactory getConnectionProfileFactory()
          Return a connection repository that can be used to query the database about database metadata.
 java.lang.Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions()
          Return the Java attribute mapping definitions that will be used to build default Java attribute mappings.
 JpaPlatformDescription getDescription()
          Return the description for this platform
 EntityGeneratorDatabaseAnnotationNameBuilder getEntityGeneratorDatabaseAnnotationNameBuilder()
          Return an entity generator database annotation name builder, which is used by Entity Generation to determine whether and how the entity generator prints the names of various database objects.
 java.lang.String getId()
          Get the ID for this platform
 java.lang.Iterable<JavaTypeMappingDefinition> getJavaTypeMappingDefinitions()
          Return the Java type mapping definitions that will be used to build Java type mappings and their corresponding annotations.
 JpaFactory getJpaFactory()
          Return a factory responsible for creating core (e.g.
 JpaPlatformVariation getJpaVariation()
          Return a platform variation that is used to determine differences platforms and/or JPA specification versions
 JpaPlatform.Version getJpaVersion()
          Get the version object for this platform.
 JptResourceType getMostRecentSupportedResourceType(org.eclipse.core.runtime.content.IContentType contentType)
          Return the most recent supported JptResourceType for the given content type.
 ResourceDefinition getResourceDefinition(JptResourceType resourceType)
          Return a ResourceDefinition to describe the context model for a file of the given resource type.
 java.lang.Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions()
          Return the Java attribute mapping definitions that will be used to build Java attribute mappings and their corresponding annotations.
 boolean supportsResourceType(JptResourceType resourceType)
          Return true if the resource type is supported.
 

Method Detail

getId

java.lang.String getId()
Get the ID for this platform


getDescription

JpaPlatformDescription getDescription()
Return the description for this platform


getJpaVersion

JpaPlatform.Version getJpaVersion()
Get the version object for this platform.


getJpaFactory

JpaFactory getJpaFactory()
Return a factory responsible for creating core (e.g. JpaProject), resource (e.g. PersistenceResource), and context (e.g. PersistenceUnit) model objects


buildJpaFile

JpaFile buildJpaFile(JpaProject jpaProject,
                     org.eclipse.core.resources.IFile file)
Return a JPA file corresponding to the specified Eclipse file. Return null if the file's content is unsupported.


getAnnotationProvider

JpaAnnotationProvider getAnnotationProvider()
Return an annotation provider responsible for determining what Java annotations are supported and constructing java resource model objects.


getAnnotationEditFormatter

AnnotationEditFormatter getAnnotationEditFormatter()
Return a formatter that can clean up the Java annotations added to source code.


getJavaTypeMappingDefinitions

java.lang.Iterable<JavaTypeMappingDefinition> getJavaTypeMappingDefinitions()
Return the Java type mapping definitions that will be used to build Java type mappings and their corresponding annotations.


getSpecifiedJavaAttributeMappingDefinitions

java.lang.Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions()
Return the Java attribute mapping definitions that will be used to build Java attribute mappings and their corresponding annotations.


getDefaultJavaAttributeMappingDefinitions

java.lang.Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions()
Return the Java attribute mapping definitions that will be used to build default Java attribute mappings.


supportsResourceType

boolean supportsResourceType(JptResourceType resourceType)
Return true if the resource type is supported. The result of this call is consistent with the result of getResourceDefinition(JptResourceType)


getResourceDefinition

ResourceDefinition getResourceDefinition(JptResourceType resourceType)
Return a ResourceDefinition to describe the context model for a file of the given resource type. Throw an IllegalArgumentException if the resource type is not supported by the platform.

Parameters:
resourceType - The resource type of a potential resource definition
Returns:
The resource definition that can be used for such a file

getMostRecentSupportedResourceType

JptResourceType getMostRecentSupportedResourceType(org.eclipse.core.runtime.content.IContentType contentType)
Return the most recent supported JptResourceType for the given content type. Throw an IllegalArgumentException if the content type is not supported by the platform.

Parameters:
contentType - A content type supported by the platform
Returns:
The most recent resource type supported by the platform

getConnectionProfileFactory

ConnectionProfileFactory getConnectionProfileFactory()
Return a connection repository that can be used to query the database about database metadata.


getEntityGeneratorDatabaseAnnotationNameBuilder

EntityGeneratorDatabaseAnnotationNameBuilder getEntityGeneratorDatabaseAnnotationNameBuilder()
Return an entity generator database annotation name builder, which is used by Entity Generation to determine whether and how the entity generator prints the names of various database objects.


getJpaVariation

JpaPlatformVariation getJpaVariation()
Return a platform variation that is used to determine differences platforms and/or JPA specification versions