Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jpa.jpql.spi
Interface IMapping

All Superinterfaces:
java.lang.Comparable<IMapping>, IExternalForm

public interface IMapping
extends IExternalForm, java.lang.Comparable<IMapping>

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

Since:
2.3
Version:
2.3
Author:
Pascal Filion
See Also:
IManagedType

Method Summary
 IMappingType getMappingType()
          Returns the type of this mapping.
 java.lang.String getName()
          Returns the name of the persistence property represented by this mapping.
 IManagedType getParent()
          Returns the parent managed type owning this mapping.
 IType getType()
          Returns the type of this mapping.
 ITypeDeclaration getTypeDeclaration()
          Returns the declaration of the Java class, which gives the information about type parameters, dimensionality, etc.
 boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Determines whether the given annotation is present on this type.

 

Methods inherited from interface java.lang.Comparable
compareTo

 

Method Detail

getMappingType

IMappingType getMappingType()
Returns the type of this mapping.
Returns:
One of the supported mapping type

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 be Collection and it's generic type will be Employee.

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:
true if the annotation is defined on this type; false otherwise

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.