Interface IMapping
-
- All Superinterfaces:
java.lang.Comparable<IMapping>
- All Known Implementing Classes:
FromSubqueryResolver.VirtualMapping
public interface IMapping extends java.lang.Comparable<IMapping>
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.
- Version:
- 2.4
- See Also:
IManagedType- Author:
- Pascal Filion
- Since:
- 2.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetMappingType()Returns the type of this mapping.java.lang.StringgetName()Returns the name of the persistence property represented by this mapping.IManagedTypegetParent()Returns the parent managed type owning this mapping.ITypegetType()Returns the type of this mapping.ITypeDeclarationgetTypeDeclaration()Returns the declaration of the Java class, which gives the information about type parameters, dimensionality, etc.booleanhasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Determines whether the given annotation is present on this type.booleanisCollection()Determines whether thisIMappingis a collection type mapping.booleanisEmbeddable()Determines whether thisIMappingis an embeddable type mapping.booleanisProperty()Determines whether thisIMappingis a property type mapping.booleanisRelationship()Determines whether thisIMappingis a relationship type mapping.booleanisTransient()Determines whether thisIMappingis a transient mapping.
-
-
-
Method Detail
-
getMappingType
int getMappingType()
Returns the type of this mapping.- Returns:
- One of the supported mapping type, which is one of the constants defined in
IMappingTypewhen the provider only supports generic JPA
-
getName
java.lang.String getName()
Returns the name of the persistence property represented by this mapping.- Returns:
- The name of this mapping
-
getParent
IManagedType getParent()
Returns the parent managed type owning this mapping.- Returns:
- The parent of this mapping
-
getType
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
Collection,getTypeDeclaration()needs to be used, its type will beCollectionand it's generic type will beEmployee.- Returns:
- The external form representing the type of this mapping
-
getTypeDeclaration
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:
- The external form of the class' type declaration
-
hasAnnotation
boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determines whether the given annotation is present on this type.- Parameters:
annotationType- The class of the annotation- Returns:
trueif the annotation is defined on this type;falseotherwise
-
isCollection
boolean isCollection()
Determines whether thisIMappingis a collection type mapping.- Returns:
trueif thisIMappingis a collection mapping;falseotherwise- Since:
- 2.4
-
isEmbeddable
boolean isEmbeddable()
Determines whether thisIMappingis an embeddable type mapping.- Returns:
trueif thisIMappingis an embeddable mapping;falseotherwise- Since:
- 2.4
-
isProperty
boolean isProperty()
Determines whether thisIMappingis a property type mapping.- Returns:
trueif thisIMappingis a property mapping;falseotherwise- Since:
- 2.4
-
isRelationship
boolean isRelationship()
Determines whether thisIMappingis a relationship type mapping.- Returns:
trueif thisIMappingis a relationship mapping;falseotherwise- Since:
- 2.4
-
-