org.eclipse.jpt.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.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.core.jpaPlatforms extension point.

Since:
2.0
Version:
2.3
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.
 JavaAttributeMappingDefinition getDefaultJavaAttributeMappingDefinition(JavaPersistentAttribute attribute)
          Return a JavaAttributeMappingDefinition that describes the interpretation of the attribute as it exists, ignoring all annotations.
 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
 JavaTypeMappingDefinition getJavaTypeMappingDefinition(JavaPersistentType type)
          Return a JavaTypeMappingDefinition that describes the interpretation of the type as it exists, complete with annotations.
 JavaTypeMappingDefinition getJavaTypeMappingDefinition(java.lang.String mappingKey)
          Return a JavaTypeMappingDefinition for the given mapping key.
 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.
 JpaResourceType getMostRecentSupportedResourceType(org.eclipse.core.runtime.content.IContentType contentType)
          Return the most recent supported JpaResourceType for the given content type.
 ResourceDefinition getResourceDefinition(JpaResourceType resourceType)
          Return a ResourceDefinition to describe the context model for a file of the given resource type.
 JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(JavaPersistentAttribute attribute)
          Return a JavaAttributeMappingDefinition that describes the interpretation of the attribute as it exists, complete with annotations.
 JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(java.lang.String mappingKey)
          Return a JavaAttributeMappingDefinition for the given mapping key.
 boolean supportsResourceType(JpaResourceType resourceType)
          Return true if the resource type is supported.
 

Method Detail

getId

java.lang.String getId()
Get the ID 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.


getJavaTypeMappingDefinition

JavaTypeMappingDefinition getJavaTypeMappingDefinition(JavaPersistentType type)
Return a JavaTypeMappingDefinition that describes the interpretation of the type as it exists, complete with annotations. This may not be null (@see NullJavaTypeMappingDefinition,) else an IllegalStateException is thrown.

Parameters:
type - The persistent type to analyze
Returns:
The mapping definition used to describe the annotated state of the type

getJavaTypeMappingDefinition

JavaTypeMappingDefinition getJavaTypeMappingDefinition(java.lang.String mappingKey)
Return a JavaTypeMappingDefinition for the given mapping key. Throw an IllegalArgumentException if the key is not supported by the platform.


getDefaultJavaAttributeMappingDefinition

JavaAttributeMappingDefinition getDefaultJavaAttributeMappingDefinition(JavaPersistentAttribute attribute)
Return a JavaAttributeMappingDefinition that describes the interpretation of the attribute as it exists, ignoring all annotations. This may not be null (@see NullDefaultJavaAttributeMappingDefinition,) else an IllegalStateException is thrown.

Parameters:
attribute - The persistent attribute to analyze
Returns:
The mapping definition describing the unannotated state of the attribute

getSpecifiedJavaAttributeMappingDefinition

JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(JavaPersistentAttribute attribute)
Return a JavaAttributeMappingDefinition that describes the interpretation of the attribute as it exists, complete with annotations. It is assumed that the attribute's default mapping has already been determined. This may not be null (@see NullSpecifiedJavaAttributeMappingDefinition,) else an IllegalStateException is thrown.

Parameters:
attribute - The persistent attribute to analyze
Returns:
The mapping definition describing the annotated state of the attribute

getSpecifiedJavaAttributeMappingDefinition

JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(java.lang.String mappingKey)
Return a JavaAttributeMappingDefinition for the given mapping key. Throw an IllegalArgumentException if the key is not supported by the platform.


supportsResourceType

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


getResourceDefinition

ResourceDefinition getResourceDefinition(JpaResourceType 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

JpaResourceType getMostRecentSupportedResourceType(org.eclipse.core.runtime.content.IContentType contentType)
Return the most recent supported JpaResourceType 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