Dali Provisional API
Release 3.2

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

All Superinterfaces:
IAdaptable, IdTypeMapping, JpaContextModel, JpaModel, JptResourceTypeReference, Model, TypeMapping
All Known Subinterfaces:
EclipseLinkEntity, EclipseLinkJavaEntity, EclipseLinkOrmEntity, JavaEntity, JavaEntity2_0, OrmEntity, OrmEntity2_0

public interface Entity
extends IdTypeMapping

entity

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

Nested Class Summary
static class Entity.IsDescendant
           
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.IdTypeMapping
IdTypeMapping.SuperTypeMappingTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.TypeMapping
TypeMapping.GeneratorsTransformer, TypeMapping.MappingIsIdMapping, TypeMapping.PersistentTypeTransformer, TypeMapping.QueriesTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaModel
JpaModel.JpaVersionIsCompatibleWith
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
JptResourceTypeReference.ResourceTypeIsKindOf, JptResourceTypeReference.ResourceTypeTransformer
 
Field Summary
static String DEFAULT_DISCRIMINATOR_VALUE_PROPERTY
           
static String DEFAULT_INHERITANCE_STRATEGY_PROPERTY
           
static String DEFAULT_NAME_PROPERTY
           
static String DESCENDANTS_COLLECTION
           
static String DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY
           
static String DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY
           
static String ROOT_ENTITY_PROPERTY
           
static String SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY
           
static String SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY
           
static String SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY
           
static String SPECIFIED_INHERITANCE_STRATEGY_PROPERTY
           
static String SPECIFIED_NAME_PROPERTY
           
static String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST
           
static String SPECIFIED_SECONDARY_TABLES_LIST
           
static String SPECIFIED_TABLE_IS_ALLOWED_PROPERTY
           
static String TABLE_IS_UNDEFINED_PROPERTY
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.TypeMapping
GENERATORS_TRANSFORMER, ID_ATTRIBUTE_MAPPING_KEYS, PERSISTENT_TYPE_TRANSFORMER, QUERIES_TRANSFORMER, SUPER_TYPE_MAPPING_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
TRANSFORMER
 
Method Summary
 SpecifiedPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn()
           
 SpecifiedPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)
           
 SpecifiedSecondaryTable addSpecifiedSecondaryTable()
          Add a specified secondary table to the entity return the object representing it.
 SpecifiedSecondaryTable addSpecifiedSecondaryTable(int index)
          Add a specified secondary table to the entity return the object representing it.
 void clearSpecifiedPrimaryKeyJoinColumns()
          Remove all the specified primary key join columns.
 void convertDefaultPrimaryKeyJoinColumnsToSpecified()
          Add specified primary key join column for each default join column with the same name and referenced column name.
 boolean discriminatorColumnIsUndefined()
          Return whether a DiscriminatorColumn is undefined for this Entity.
 boolean discriminatorValueIsUndefined()
          Return whether a DiscriminatorValue is undefined for this Entity.
 AssociationOverrideContainer getAssociationOverrideContainer()
           
 AttributeOverrideContainer getAttributeOverrideContainer()
           
 String getDefaultCatalog()
          Return the entity's default catalog, which depends on the entity's inheritance hierarchy.
 String getDefaultDiscriminatorValue()
           
 InheritanceType getDefaultInheritanceStrategy()
           
 String getDefaultName()
           
 String getDefaultSchema()
          Return the entity's default schema, which depends on the entity's inheritance hierarchy.
 String getDefaultTableName()
          Return the entity's default table name, which depends on the entity's inheritance hierarchy.
 Iterable<Entity> getDescendants()
          If the entity is a root entity, return the entity's descendant entities; if the entity is not a root entity, return an empty collection.
 SpecifiedDiscriminatorColumn getDiscriminatorColumn()
           
 String getDiscriminatorValue()
           
 GeneratorContainer getGeneratorContainer()
           
 SpecifiedPersistentAttribute getIdAttribute()
          If an entity has a single id attribute, return that attribute.
 InheritanceType getInheritanceStrategy()
          Return the specified inheritance strategy if present, otherwise return the default inheritance strategy.
 TextRange getNameTextRange()
          Returns the TextRange of the name property.
 Entity getParentEntity()
          The first parent in the class hierarchy that is an entity.
 String getPrimaryKeyColumnName()
          Return the name of the entity's primary key column.
 org.eclipse.jpt.common.utility.iterable.ListIterable<? extends PrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
           
 int getPrimaryKeyJoinColumnsSize()
           
 QueryContainer getQueryContainer()
           
 Entity getRootEntity()
          Return the top of the entity's inheritance hierarchy.
 org.eclipse.jpt.common.utility.iterable.ListIterable<? extends SecondaryTable> getSecondaryTables()
          Return the secondary tables whether specified or default.
 int getSecondaryTablesSize()
          Return the number of secondary tables, both specified and default.
 String getSpecifiedDiscriminatorValue()
           
 InheritanceType getSpecifiedInheritanceStrategy()
           
 String getSpecifiedName()
           
 SpecifiedPrimaryKeyJoinColumn getSpecifiedPrimaryKeyJoinColumn(int index)
           
 org.eclipse.jpt.common.utility.iterable.ListIterable<? extends SpecifiedPrimaryKeyJoinColumn> getSpecifiedPrimaryKeyJoinColumns()
           
 int getSpecifiedPrimaryKeyJoinColumnsSize()
           
 org.eclipse.jpt.common.utility.iterable.ListIterable<? extends SpecifiedSecondaryTable> getSpecifiedSecondaryTables()
          Return a list iterator of the specified secondary tables.
 int getSpecifiedSecondaryTablesSize()
          Return the number of specified secondary tables.
 SpecifiedTable getTable()
          Return the entity's table, either specified or default.
 void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex)
           
 void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex)
          Move the specified secondary table from the source index to the target index.
 void removeSpecifiedPrimaryKeyJoinColumn(int index)
           
 void removeSpecifiedPrimaryKeyJoinColumn(SpecifiedPrimaryKeyJoinColumn primaryKeyJoinColumn)
           
 void removeSpecifiedSecondaryTable(int index)
          Remove the specified secondary table from the entity.
 void removeSpecifiedSecondaryTable(SpecifiedSecondaryTable secondaryTable)
          Remove the specified secondary table at the index from the entity.
 AttributeMapping resolveAttributeMapping(String name)
          Returns the attribute mapping that matches the name.
 void setSpecifiedDiscriminatorValue(String value)
           
 void setSpecifiedInheritanceStrategy(InheritanceType inheritanceType)
           
 void setSpecifiedName(String name)
           
 boolean specifiedDiscriminatorColumnIsAllowed()
          Return whether a DiscriminatorColumn is allowed for this Entity.
 boolean specifiedDiscriminatorValueIsAllowed()
          Return whether a DiscriminatorValue is allowed for this Entity.
 boolean specifiedTableIsAllowed()
          Return whether a Table is allowed for this Entity.
 boolean supportsValidationMessages()
          Return whether this entity should be validated and have validation messages displayed
 boolean tableIsUndefined()
          Return whether a Table is undefined for this Entity.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.IdTypeMapping
getIdClassReference, getInheritanceHierarchy, getPrimaryKeyClassName, isRootEntity
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.TypeMapping
attributeIsDerivedId, attributeMappingKeyAllowed, getAllAssociatedTableNames, getAllAssociatedTables, getAllAttributeMappings, getAllAttributeMappings, getAllOverridableAssociationNames, getAllOverridableAttributeNames, getAncestors, getAssociatedTables, getAttributeMappings, getAttributeMappings, getDbSchema, getGenerators, getIdAttributeMapping, getIdAttributeMappings, getJavaResourceType, getKey, getName, getNonTransientAttributeMappings, getOverridableAssociationNames, getOverridableAttributeNames, getPersistentType, getPrimaryDbTable, getPrimaryTableName, getQueries, getSuperTypeMapping, isMapped, resolveDbTable, resolveOverriddenColumn, resolveOverriddenRelationship, tableNameIsInvalid, validatesAgainstDatabase
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextModel
getCompletionProposals, getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getParent, getPersistenceUnit, getValidationTextRange, synchronizeWithResourceModel, update, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaModel
getJpaPlatform, getJpaProject, getJpaProjectManager, getResource, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
getResourceType
 

Field Detail

SPECIFIED_NAME_PROPERTY

static final String SPECIFIED_NAME_PROPERTY
See Also:
Constant Field Values

DEFAULT_NAME_PROPERTY

static final String DEFAULT_NAME_PROPERTY
See Also:
Constant Field Values

SPECIFIED_SECONDARY_TABLES_LIST

static final String SPECIFIED_SECONDARY_TABLES_LIST
See Also:
Constant Field Values

SPECIFIED_INHERITANCE_STRATEGY_PROPERTY

static final String SPECIFIED_INHERITANCE_STRATEGY_PROPERTY
See Also:
Constant Field Values

DEFAULT_INHERITANCE_STRATEGY_PROPERTY

static final String DEFAULT_INHERITANCE_STRATEGY_PROPERTY
See Also:
Constant Field Values

SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY

static final String SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY
See Also:
Constant Field Values

DEFAULT_DISCRIMINATOR_VALUE_PROPERTY

static final String DEFAULT_DISCRIMINATOR_VALUE_PROPERTY
See Also:
Constant Field Values

SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY

static final String SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY
See Also:
Constant Field Values

DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY

static final String DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY
See Also:
Constant Field Values

SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY

static final String SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY
See Also:
Constant Field Values

DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY

static final String DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY
See Also:
Constant Field Values

SPECIFIED_TABLE_IS_ALLOWED_PROPERTY

static final String SPECIFIED_TABLE_IS_ALLOWED_PROPERTY
See Also:
Constant Field Values

TABLE_IS_UNDEFINED_PROPERTY

static final String TABLE_IS_UNDEFINED_PROPERTY
See Also:
Constant Field Values

SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST

static final String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST
See Also:
Constant Field Values

ROOT_ENTITY_PROPERTY

static final String ROOT_ENTITY_PROPERTY
See Also:
Constant Field Values

DESCENDANTS_COLLECTION

static final String DESCENDANTS_COLLECTION
See Also:
Constant Field Values
Method Detail

getSpecifiedName

String getSpecifiedName()

setSpecifiedName

void setSpecifiedName(String name)

getDefaultName

String getDefaultName()

getTable

SpecifiedTable getTable()
Return the entity's table, either specified or default. This will not be null.

See Also:
SpecifiedTable.isSpecifiedInResource()

getPrimaryKeyColumnName

String getPrimaryKeyColumnName()
Return the name of the entity's primary key column. Return null if the entity's primary key is "compound" (i.e. the primary key is composed of multiple columns).


getDefaultTableName

String getDefaultTableName()
Return the entity's default table name, which depends on the entity's inheritance hierarchy.


getDefaultSchema

String getDefaultSchema()
Return the entity's default schema, which depends on the entity's inheritance hierarchy.


getDefaultCatalog

String getDefaultCatalog()
Return the entity's default catalog, which depends on the entity's inheritance hierarchy.


getSecondaryTables

org.eclipse.jpt.common.utility.iterable.ListIterable<? extends SecondaryTable> getSecondaryTables()
Return the secondary tables whether specified or default.


getSecondaryTablesSize

int getSecondaryTablesSize()
Return the number of secondary tables, both specified and default.


getSpecifiedSecondaryTables

org.eclipse.jpt.common.utility.iterable.ListIterable<? extends SpecifiedSecondaryTable> getSpecifiedSecondaryTables()
Return a list iterator of the specified secondary tables. This will not be null.


getSpecifiedSecondaryTablesSize

int getSpecifiedSecondaryTablesSize()
Return the number of specified secondary tables.


addSpecifiedSecondaryTable

SpecifiedSecondaryTable addSpecifiedSecondaryTable()
Add a specified secondary table to the entity return the object representing it.


addSpecifiedSecondaryTable

SpecifiedSecondaryTable addSpecifiedSecondaryTable(int index)
Add a specified secondary table to the entity return the object representing it.


removeSpecifiedSecondaryTable

void removeSpecifiedSecondaryTable(int index)
Remove the specified secondary table from the entity.


removeSpecifiedSecondaryTable

void removeSpecifiedSecondaryTable(SpecifiedSecondaryTable secondaryTable)
Remove the specified secondary table at the index from the entity.


moveSpecifiedSecondaryTable

void moveSpecifiedSecondaryTable(int targetIndex,
                                 int sourceIndex)
Move the specified secondary table from the source index to the target index.


getInheritanceStrategy

InheritanceType getInheritanceStrategy()
Return the specified inheritance strategy if present, otherwise return the default inheritance strategy.

Specified by:
getInheritanceStrategy in interface IdTypeMapping

getSpecifiedInheritanceStrategy

InheritanceType getSpecifiedInheritanceStrategy()

setSpecifiedInheritanceStrategy

void setSpecifiedInheritanceStrategy(InheritanceType inheritanceType)

getDefaultInheritanceStrategy

InheritanceType getDefaultInheritanceStrategy()

getParentEntity

Entity getParentEntity()
The first parent in the class hierarchy that is an entity. This is the parent in the entity (persistent) inheritance hierarchy (vs class inheritance hierarchy). Return null if there is no parent entity.


getDiscriminatorColumn

SpecifiedDiscriminatorColumn getDiscriminatorColumn()

getDiscriminatorValue

String getDiscriminatorValue()

getSpecifiedDiscriminatorValue

String getSpecifiedDiscriminatorValue()

setSpecifiedDiscriminatorValue

void setSpecifiedDiscriminatorValue(String value)

getDefaultDiscriminatorValue

String getDefaultDiscriminatorValue()

specifiedDiscriminatorValueIsAllowed

boolean specifiedDiscriminatorValueIsAllowed()
Return whether a DiscriminatorValue is allowed for this Entity. It is allowed if the entity is not abstract and not part of a table-per-class inheritance hierarchy


discriminatorValueIsUndefined

boolean discriminatorValueIsUndefined()
Return whether a DiscriminatorValue is undefined for this Entity. It is undefined if the entity is abstract or if it is part of a table-per-class inheritance hierarchy


specifiedDiscriminatorColumnIsAllowed

boolean specifiedDiscriminatorColumnIsAllowed()
Return whether a DiscriminatorColumn is allowed for this Entity. It is allowed if the entity is the root of the inheritance hierarchy (with descendant entities) and the strategy is not table-per-class


discriminatorColumnIsUndefined

boolean discriminatorColumnIsUndefined()
Return whether a DiscriminatorColumn is undefined for this Entity. It is undefined if the inheritance strategy is table-per-class


specifiedTableIsAllowed

boolean specifiedTableIsAllowed()
Return whether a Table is allowed for this Entity. If the inheritance strategy is single-table, Table is allowed only on the root entity. If the inheritance strategy is table-per-class it is allowed only on concrete entities.


tableIsUndefined

boolean tableIsUndefined()
Return whether a Table is undefined for this Entity. If the inheritance strategy is table-per-class and the entity is abstract, then a Table object is undefined


getPrimaryKeyJoinColumns

org.eclipse.jpt.common.utility.iterable.ListIterable<? extends PrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()

getPrimaryKeyJoinColumnsSize

int getPrimaryKeyJoinColumnsSize()

getSpecifiedPrimaryKeyJoinColumns

org.eclipse.jpt.common.utility.iterable.ListIterable<? extends SpecifiedPrimaryKeyJoinColumn> getSpecifiedPrimaryKeyJoinColumns()

getSpecifiedPrimaryKeyJoinColumn

SpecifiedPrimaryKeyJoinColumn getSpecifiedPrimaryKeyJoinColumn(int index)

getSpecifiedPrimaryKeyJoinColumnsSize

int getSpecifiedPrimaryKeyJoinColumnsSize()

addSpecifiedPrimaryKeyJoinColumn

SpecifiedPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)

addSpecifiedPrimaryKeyJoinColumn

SpecifiedPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn()

removeSpecifiedPrimaryKeyJoinColumn

void removeSpecifiedPrimaryKeyJoinColumn(int index)

removeSpecifiedPrimaryKeyJoinColumn

void removeSpecifiedPrimaryKeyJoinColumn(SpecifiedPrimaryKeyJoinColumn primaryKeyJoinColumn)

moveSpecifiedPrimaryKeyJoinColumn

void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex,
                                       int sourceIndex)

convertDefaultPrimaryKeyJoinColumnsToSpecified

void convertDefaultPrimaryKeyJoinColumnsToSpecified()
Add specified primary key join column for each default join column with the same name and referenced column name. As a side-effect in the update, the default primary key join columns will be recalculated.


clearSpecifiedPrimaryKeyJoinColumns

void clearSpecifiedPrimaryKeyJoinColumns()
Remove all the specified primary key join columns. As a side-effect in the update, the default primary key join columns will be recalculated.


getAttributeOverrideContainer

AttributeOverrideContainer getAttributeOverrideContainer()

getAssociationOverrideContainer

AssociationOverrideContainer getAssociationOverrideContainer()

getQueryContainer

QueryContainer getQueryContainer()

getGeneratorContainer

GeneratorContainer getGeneratorContainer()

getRootEntity

Entity getRootEntity()
Return the top of the entity's inheritance hierarchy. This method will never return null. The root is defined as the persistent type in the inheritance hierarchy that has no parent. The root will be an entity.

Non-entities in the hierarchy should be ignored; i.e. we skip over them in the search for the root.

Specified by:
getRootEntity in interface IdTypeMapping

getDescendants

Iterable<Entity> getDescendants()
If the entity is a root entity, return the entity's descendant entities; if the entity is not a root entity, return an empty collection.

NB: An entity A is a "descendant" of another root entity B if the name of entity A's root entity's type matches the name of entity B's type. This means entity A can be a "descendant" of multiple root entities (typically both the orm.xml and Java root entities for a particular type); despite entity have only a single "root" entity (typically the orm.xml root entity).


getNameTextRange

TextRange getNameTextRange()
Returns the TextRange of the name property.


supportsValidationMessages

boolean supportsValidationMessages()
Return whether this entity should be validated and have validation messages displayed


resolveAttributeMapping

AttributeMapping resolveAttributeMapping(String name)
Returns the attribute mapping that matches the name. In 2.0 this name could use dot-notation for nested mappings.


getIdAttribute

SpecifiedPersistentAttribute getIdAttribute()
If an entity has a single id attribute, return that attribute. Else return null.


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.