Top Description Methods
org.eclipse.persistence.jpa.jpql.tools.spi

public Interface IMapping

extends IExternalForm, Comparable<IMapping>
Known Direct Implementers
org.eclipse.persistence.jpa.jpql.tools.resolver.FromSubqueryResolver.VirtualMapping
Imports
java.lang.annotation.Annotation

The external representation of a mapping, which represents a single persistence property of a managed type.

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.

Author
Pascal Filion
Since
2.3
Version
2.4
See Also
IManagedType

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

One of the supported mapping type, which is one of the constants defined in IMappingType when the provider only supports generic JPA
getMappingType
()

Returns the type of this mapping.

public String

Returns:

The name of this mapping
getName
()

Returns the name of the persistence property represented by this mapping.

public IManagedType

Returns:

The parent of this mapping
getParent
()

Returns the parent managed type owning this mapping.

public IType

Returns:

The external form representing the type of this mapping
getType
()

Returns the type of this mapping.

public ITypeDeclaration

Returns:

The external form of the class' type declaration
getTypeDeclaration
()

Returns the declaration of the Java class, which gives the information about type parameters, dimensionality, etc.

@OneToMany private Collection<Employee> employees;

"Collection<Employee>" is the type declaration.

public boolean

Returns:

true if the annotation is defined on this type; false otherwise
hasAnnotation
(Class<? extends Annotation>
The class of the annotation
annotationType
)

Determines whether the given annotation is present on this type.

public boolean

Returns:

true if this IMapping is a collection mapping; false otherwise
isCollection
()

Determines whether this IMapping is a collection type mapping.

public boolean

Returns:

true if this IMapping is an embeddable mapping; false otherwise
isEmbeddable
()

Determines whether this IMapping is an embeddable type mapping.

public boolean

Returns:

true if this IMapping is a property mapping; false otherwise
isProperty
()

Determines whether this IMapping is a property type mapping.

public boolean

Returns:

true if this IMapping is a relationship mapping; false otherwise
isRelationship
()

Determines whether this IMapping is a relationship type mapping.

public boolean

Returns:

true if this IMapping is a transient mapping; false otherwise
isTransient
()

Determines whether this IMapping is a transient mapping.

Inherited from java.lang.Comparable:
compareTo

Method Detail

getMappingTypeback to summary
public int getMappingType()

Returns the type of this mapping.

Returns:int

One of the supported mapping type, which is one of the constants defined in IMappingType when the provider only supports generic JPA

getNameback to summary
public String getName()

Returns the name of the persistence property represented by this mapping.

Returns:String

The name of this mapping

getParentback to summary
public IManagedType getParent()

Returns the parent managed type owning this mapping.

Returns:IManagedType

The parent of this mapping

getTypeback to summary
public IType getType()

Returns the type of this mapping. If this mapping is a relationship mapping, the parameter type of the collection is returned.

@OneToMany
private Collection<Employee> employees;

"Employee" is the type. To retrieve java.util.Collection, getTypeDeclaration() needs to be used, its type will be java.util.Collection and it's generic type will be Employee.

Returns:IType

The external form representing the type of this mapping

getTypeDeclarationback to summary
public ITypeDeclaration getTypeDeclaration()

Returns the declaration of the Java class, which gives the information about type parameters, dimensionality, etc.

@OneToMany
private Collection<Employee> employees;

"Collection<Employee>" is the type declaration.

Returns:ITypeDeclaration

The external form of the class' type declaration

hasAnnotationback to summary
public boolean hasAnnotation(Class<? extends Annotation> annotationType)

Determines whether the given annotation is present on this type.

Parameters
annotationType:Class<? extends Annotation>

The class of the annotation

Returns:boolean

true if the annotation is defined on this type; false otherwise

isCollectionback to summary
public boolean isCollection()

Determines whether this IMapping is a collection type mapping.

Returns:boolean

true if this IMapping is a collection mapping; false otherwise

Since
2.4
isEmbeddableback to summary
public boolean isEmbeddable()

Determines whether this IMapping is an embeddable type mapping.

Returns:boolean

true if this IMapping is an embeddable mapping; false otherwise

Since
2.4
isPropertyback to summary
public boolean isProperty()

Determines whether this IMapping is a property type mapping.

Returns:boolean

true if this IMapping is a property mapping; false otherwise

Since
2.4
isRelationshipback to summary
public boolean isRelationship()

Determines whether this IMapping is a relationship type mapping.

Returns:boolean

true if this IMapping is a relationship mapping; false otherwise

Since
2.4
isTransientback to summary
public boolean isTransient()

Determines whether this IMapping is a transient mapping.

Returns:boolean

true if this IMapping is a transient mapping; false otherwise

Since
2.4