org.eclipse.jpt.jpa.core.context
Interface PersistentType

All Superinterfaces:
AccessHolder, org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, Model, ReadOnlyAccessHolder
All Known Subinterfaces:
JavaPersistentType, JavaPersistentType2_0, OrmPersistentType, OrmPersistentType2_0, PersistentType2_0

public interface PersistentType
extends JpaContextNode, JpaStructureNode, AccessHolder

Context persistent 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.

Since:
2.0
Version:
2.3

Nested Class Summary
static interface PersistentType.Owner
           
 
Field Summary
static java.lang.String MAPPING_PROPERTY
           
static java.lang.String NAME_PROPERTY
           
static java.lang.String SUPER_PERSISTENT_TYPE_PROPERTY
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.AccessHolder
DEFAULT_ACCESS_PROPERTY, SPECIFIED_ACCESS_PROPERTY
 
Method Summary
 java.util.Iterator<java.lang.String> allAttributeNames()
          Return the names of all the persistent attributes in the persistent type's hierarchy.
 java.util.Iterator<ReadOnlyPersistentAttribute> allAttributes()
          Return all the persistent attributes in the persistent type's inheritance hierarchy.
 java.util.Iterator<PersistentType> ancestors()
          Return the persistent type's "persistence" inheritance hierarchy, excluding the persistent type itself.
 java.util.Iterator<java.lang.String> attributeNames()
          Return the names of the persistent type's persistent attributes.
<T extends ReadOnlyPersistentAttribute>
java.util.ListIterator<T>
attributes()
          Return the persistent type's persistent attributes.
 int attributesSize()
          Return the number of the persistent type's persistent attributes.
 ReadOnlyPersistentAttribute getAttributeNamed(java.lang.String attributeName)
          Return the persistent attribute with the specified name, if it exists locally on the persistent type (as opposed to in its inheritance hierarchy).
 TypeMapping getMapping()
          Return the persistent type's mapping.
 java.lang.String getMappingKey()
           
 java.lang.String getName()
          Return the persistent type's [fully-qualified] name.
 AccessType getOwnerDefaultAccess()
          Return the client persistent type's default access type; null if there is no such access default.
 AccessType getOwnerOverrideAccess()
          Return the access type that overrides the client persistent type's access type; null if there is no such access override.
 java.lang.String getSimpleName()
          Return the persistent type's simple name.
 PersistentType getSuperPersistentType()
          Return the "super" PersistentType from the "persistence" inheritance hierarchy.
 TextRange getValidationTextRange()
          Return the text range to be used with any validation messages related to the persistent type.
 java.util.Iterator<PersistentType> inheritanceHierarchy()
          Return the persistent type's "persistence" inheritance hierarchy, including the persistent type itself.
 boolean isFor(java.lang.String typeName)
          Return whether the persistent type applies to the specified type name qualified with '.'.
 boolean isIn(org.eclipse.jdt.core.IPackageFragment packageFragment)
          Return whether the persistent type resolves to a Java class in the specified package fragment.
 boolean isMapped()
           
 ReadOnlyPersistentAttribute resolveAttribute(java.lang.String attributeName)
          Resolve and return the persistent attribute with the specified name, if it is distinct and exists within the context of the persistent type.
 void setMappingKey(java.lang.String key)
           
 void validate(java.util.List<org.eclipse.wst.validation.internal.provisional.core.IMessage> messages, org.eclipse.wst.validation.internal.provisional.core.IReporter reporter)
          Add to the list of current validation messages
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, synchronizeWithResourceModel, update
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaNode
getJpaProject, getParent, stateChanged
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.IResourcePart
getResource
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.AccessHolder
getDefaultAccess, getSpecifiedAccess, setSpecifiedAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ReadOnlyAccessHolder
getAccess
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 

Field Detail

NAME_PROPERTY

static final java.lang.String NAME_PROPERTY
See Also:
Constant Field Values

MAPPING_PROPERTY

static final java.lang.String MAPPING_PROPERTY
See Also:
Constant Field Values

SUPER_PERSISTENT_TYPE_PROPERTY

static final java.lang.String SUPER_PERSISTENT_TYPE_PROPERTY
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Return the persistent type's [fully-qualified] name. The enclosing type separator is '.', as opposed to '$'.

See Also:
getSimpleName()

getSimpleName

java.lang.String getSimpleName()
Return the persistent type's simple name.

See Also:
getName()

getMapping

TypeMapping getMapping()
Return the persistent type's mapping. Set the mapping via setMappingKey(String).


getMappingKey

java.lang.String getMappingKey()

setMappingKey

void setMappingKey(java.lang.String key)

isMapped

boolean isMapped()

attributes

<T extends ReadOnlyPersistentAttribute> java.util.ListIterator<T> attributes()
Return the persistent type's persistent attributes.


attributesSize

int attributesSize()
Return the number of the persistent type's persistent attributes.


attributeNames

java.util.Iterator<java.lang.String> attributeNames()
Return the names of the persistent type's persistent attributes.


allAttributes

java.util.Iterator<ReadOnlyPersistentAttribute> allAttributes()
Return all the persistent attributes in the persistent type's inheritance hierarchy.


allAttributeNames

java.util.Iterator<java.lang.String> allAttributeNames()
Return the names of all the persistent attributes in the persistent type's hierarchy.


getAttributeNamed

ReadOnlyPersistentAttribute getAttributeNamed(java.lang.String attributeName)
Return the persistent attribute with the specified name, if it exists locally on the persistent type (as opposed to in its inheritance hierarchy).


resolveAttribute

ReadOnlyPersistentAttribute resolveAttribute(java.lang.String attributeName)
Resolve and return the persistent attribute with the specified name, if it is distinct and exists within the context of the persistent type.


getSuperPersistentType

PersistentType getSuperPersistentType()
Return the "super" PersistentType from the "persistence" inheritance hierarchy. If the Java inheritance parent is not a PersistentType, then continue up the hierarchy (the JPA spec allows non-persistent types to be part of the hierarchy.) Return null if the persistent type is the root persistent type.

Example:

 @Entity
 public abstract class Model {}
 
 public abstract class Animal extends Model {}
 
 @Entity
 public class Cat extends Animal {}
 
The "super" persistent type of the Cat persistent type is the Model persistent type. The "super" persistent type can be either a Java annotated class or declared in the XML files.


inheritanceHierarchy

java.util.Iterator<PersistentType> inheritanceHierarchy()
Return the persistent type's "persistence" inheritance hierarchy, including the persistent type itself. The returned iterator will return elements infinitely if the hierarchy has a loop.


ancestors

java.util.Iterator<PersistentType> ancestors()
Return the persistent type's "persistence" inheritance hierarchy, excluding the persistent type itself. The returned iterator will return elements infinitely if the hierarchy has a loop.


validate

void validate(java.util.List<org.eclipse.wst.validation.internal.provisional.core.IMessage> messages,
              org.eclipse.wst.validation.internal.provisional.core.IReporter reporter)
Add to the list of current validation messages


getValidationTextRange

TextRange getValidationTextRange()
Return the text range to be used with any validation messages related to the persistent type.


isFor

boolean isFor(java.lang.String typeName)
Return whether the persistent type applies to the specified type name qualified with '.'.


isIn

boolean isIn(org.eclipse.jdt.core.IPackageFragment packageFragment)
Return whether the persistent type resolves to a Java class in the specified package fragment.


getOwnerOverrideAccess

AccessType getOwnerOverrideAccess()
Return the access type that overrides the client persistent type's access type; null if there is no such access override.


getOwnerDefaultAccess

AccessType getOwnerDefaultAccess()
Return the client persistent type's default access type; null if there is no such access default.