org.eclipse.jpt.core.context
Interface PersistentType

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, Model
All Known Subinterfaces:
JavaPersistentType, OrmPersistentType

public interface PersistentType
extends JpaContextNode, JpaStructureNode

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.


Field Summary
static java.lang.String ACCESS_PROPERTY
           
static java.lang.String MAPPING_PROPERTY
           
static java.lang.String NAME_PROPERTY
           
static java.lang.String PARENT_PERSISTENT_TYPE_PROPERTY
           
static java.lang.String SPECIFIED_ATTRIBUTES_LIST
           
 
Method Summary
 java.util.Iterator<java.lang.String> allAttributeNames()
           
 java.util.Iterator<PersistentAttribute> allAttributes()
          Return a read-only iterator of the all the PersistentAttributes in the hierarchy
 java.util.Iterator<PersistentType> ancestors()
          Excludes the present persistent type.
 java.util.Iterator<java.lang.String> attributeNames()
           
<T extends PersistentAttribute>
java.util.ListIterator<T>
attributes()
          Return a read-only iterator of the contained PersistentAttribute
 int attributesSize()
          Return the size of PersistentAttributes list
 AccessType getAccess()
           
 PersistentAttribute getAttributeNamed(java.lang.String attributeName)
          Return the attribute named attributeName if it exists locally on this type
 PersistentTypeContext getContext()
          Return the owning context
 TypeMapping getMapping()
           
 java.lang.String getMappingKey()
           
 java.lang.String getName()
           
 PersistentType getParentPersistentType()
          Return the parent PersistentType from the inheritance hierarchy.
 java.lang.String getShortName()
           
 java.util.Iterator<PersistentType> inheritanceHierarchy()
          Includes the present persistent type.
 boolean isMapped()
           
 PersistentAttribute resolveAttribute(java.lang.String attributeName)
          Resolve and return the attribute named attributeName if it is distinct and exists within the context of this type
 void setMappingKey(java.lang.String key)
           
 void validate(java.util.List<org.eclipse.wst.validation.internal.provisional.core.IMessage> messages)
          Add to the list of current validation messages
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addCollectionChangeListener, addCollectionChangeListener, addListChangeListener, addListChangeListener, addPropertyChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, addTreeChangeListener, removeCollectionChangeListener, removeCollectionChangeListener, removeListChangeListener, removeListChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getId, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addCollectionChangeListener, addCollectionChangeListener, addListChangeListener, addListChangeListener, addPropertyChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, addTreeChangeListener, removeCollectionChangeListener, removeCollectionChangeListener, removeListChangeListener, removeListChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 

Field Detail

NAME_PROPERTY

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

ACCESS_PROPERTY

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

MAPPING_PROPERTY

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

PARENT_PERSISTENT_TYPE_PROPERTY

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

SPECIFIED_ATTRIBUTES_LIST

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

getContext

PersistentTypeContext getContext()
Return the owning context


getName

java.lang.String getName()

getShortName

java.lang.String getShortName()

getAccess

AccessType getAccess()

getMapping

TypeMapping getMapping()

getMappingKey

java.lang.String getMappingKey()

setMappingKey

void setMappingKey(java.lang.String key)

isMapped

boolean isMapped()

getParentPersistentType

PersistentType getParentPersistentType()
Return the parent PersistentType from the 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 this persistentType is the root persistent type. Example:
 @Entity
 public abstract class Model {}
 
 public abstract class Animal extends Model {}
 
 @Entity
 public class Cat extends Animal {}
 
If this is the Cat JavaPersistentType then parentPersistentType is the Model JavaPersistentType The parentPersistentType could be found in java or xml.


attributes

<T extends PersistentAttribute> java.util.ListIterator<T> attributes()
Return a read-only iterator of the contained PersistentAttribute


attributesSize

int attributesSize()
Return the size of PersistentAttributes list

Returns:

attributeNames

java.util.Iterator<java.lang.String> attributeNames()

allAttributes

java.util.Iterator<PersistentAttribute> allAttributes()
Return a read-only iterator of the all the PersistentAttributes in the hierarchy


allAttributeNames

java.util.Iterator<java.lang.String> allAttributeNames()

getAttributeNamed

PersistentAttribute getAttributeNamed(java.lang.String attributeName)
Return the attribute named attributeName if it exists locally on this type


resolveAttribute

PersistentAttribute resolveAttribute(java.lang.String attributeName)
Resolve and return the attribute named attributeName if it is distinct and exists within the context of this type


inheritanceHierarchy

java.util.Iterator<PersistentType> inheritanceHierarchy()
Includes the present persistent type.


ancestors

java.util.Iterator<PersistentType> ancestors()
Excludes the present persistent type.


validate

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