org.eclipse.jpt.core.context
Interface Entity

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, Model, TypeMapping
All Known Subinterfaces:
EclipseLinkEntity, JavaEclipseLinkEntity, JavaEntity, OrmEclipseLinkEntity, OrmEntity

public interface Entity
extends TypeMapping

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
Version:
2.3

Field Summary
static java.lang.String DEFAULT_DISCRIMINATOR_VALUE_PROPERTY
           
static java.lang.String DEFAULT_INHERITANCE_STRATEGY_PROPERTY
           
static java.lang.String DEFAULT_NAME_PROPERTY
           
static java.lang.String DEFAULT_PRIMARY_KEY_JOIN_COLUMN
           
static java.lang.String DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY
           
static java.lang.String DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY
           
static java.lang.String SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY
           
static java.lang.String SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY
           
static java.lang.String SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY
           
static java.lang.String SPECIFIED_INHERITANCE_STRATEGY_PROPERTY
           
static java.lang.String SPECIFIED_NAME_PROPERTY
           
static java.lang.String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST
           
static java.lang.String SPECIFIED_SECONDARY_TABLES_LIST
           
static java.lang.String SPECIFIED_TABLE_IS_ALLOWED_PROPERTY
           
static java.lang.String TABLE_IS_UNDEFINED_PROPERTY
           
 
Method Summary
 PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)
           
 SecondaryTable addSpecifiedSecondaryTable()
          Add a specified secondary table to the entity return the object representing it.
 SecondaryTable addSpecifiedSecondaryTable(int index)
          Add a specified secondary table to the entity return the object representing it.
 void addSubEntity(Entity subEntity)
          The given Entity has this entity as its root entity, add it as a sub entity.
 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()
           
 java.lang.String getDefaultCatalog()
          Return the entity's default catalog, which depends on the entity's inheritance hierarchy.
 java.lang.String getDefaultDiscriminatorValue()
           
 InheritanceType getDefaultInheritanceStrategy()
           
 java.lang.String getDefaultName()
          Return the default name, based on the class name.
 PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn()
           
 java.lang.String getDefaultSchema()
          Return the entity's default schema, which depends on the entity's inheritance hierarchy.
 java.lang.String getDefaultTableName()
          Return the entity's default table name, which depends on the entity's inheritance hierarchy.
 DiscriminatorColumn getDiscriminatorColumn()
           
 java.lang.String getDiscriminatorValue()
           
 GeneratorContainer getGeneratorContainer()
           
 PersistentAttribute getIdAttribute()
          If an entity has a single id attribute, return that attribute.
 IdClassReference getIdClassReference()
          Return the (aggregate) class reference for configuring and validating id class
 InheritanceType getInheritanceStrategy()
           
 java.lang.String getName()
          Return the name, specified or default if not specified.
 Entity getParentEntity()
          The first parent in the class hierarchy that is an entity.
 java.lang.String getPrimaryKeyColumnName()
          Return the name of the entity's primary key column.
 QueryContainer getQueryContainer()
           
 Entity getRootEntity()
          Return the ultimate top of the inheritance hierarchy This method should never return null.
 java.lang.String getSpecifiedDiscriminatorValue()
           
 InheritanceType getSpecifiedInheritanceStrategy()
           
 java.lang.String getSpecifiedName()
          Return the specified name.
 Table getTable()
          Return the table for this entity, either specified or default.
 boolean isRoot()
          Return whether this entity is a root entity in an inheritance hierarchy
 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.
<T extends PrimaryKeyJoinColumn>
java.util.ListIterator<T>
primaryKeyJoinColumns()
           
 int primaryKeyJoinColumnsSize()
           
 void removeSpecifiedPrimaryKeyJoinColumn(int index)
           
 void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn)
           
 void removeSpecifiedSecondaryTable(int index)
          Remove the specified secondary table from the entity.
 void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable)
          Remove the specified secondary table at the index from the entity.
 AttributeMapping resolveAttributeMapping(java.lang.String name)
          Returns the attribute mapping that matches the name.
<T extends SecondaryTable>
java.util.ListIterator<T>
secondaryTables()
          Return a list iterator of the secondary tables whether specified or default.
 int secondaryTablesSize()
          Return the number of secondary tables, both specified and default.
 void setSpecifiedDiscriminatorValue(java.lang.String value)
           
 void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType)
           
 void setSpecifiedName(java.lang.String value)
          Set the specified name on the entity.
 boolean specifiedDiscriminatorColumnIsAllowed()
          Return whether a DiscriminatorColumn is allowed for this Entity.
 boolean specifiedDiscriminatorValueIsAllowed()
          Return whether a DiscriminatorValue is allowed for this Entity.
<T extends PrimaryKeyJoinColumn>
java.util.ListIterator<T>
specifiedPrimaryKeyJoinColumns()
           
 int specifiedPrimaryKeyJoinColumnsSize()
           
<T extends SecondaryTable>
java.util.ListIterator<T>
specifiedSecondaryTables()
          Return a list iterator of the specified secondary tables.
 int specifiedSecondaryTablesSize()
          Return the number of specified secondary tables.
 boolean specifiedTableIsAllowed()
          Return whether a Table is allowed for this Entity.
 boolean tableIsUndefined()
          Return whether a Table is undefined for this Entity.
 
Methods inherited from interface org.eclipse.jpt.core.context.TypeMapping
allAttributeMappings, allOverridableAssociationNames, allOverridableAttributeNames, associatedTableNamesIncludingInherited, associatedTables, associatedTablesIncludingInherited, attributeMappingKeyAllowed, attributeMappings, getAllAttributeMappings, getAttributeMappings, getDbSchema, getDbTable, getIdClass, getKey, getPersistentType, getPrimaryDbTable, getPrimaryTableName, getSuperTypeMapping, inheritanceHierarchy, isMapped, overridableAssociationNames, overridableAttributeNames, resolveOverriddenColumn, resolveRelationshipReference, shouldValidateAgainstDatabase, tableNameIsInvalid
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, postUpdate
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 

Field Detail

SPECIFIED_NAME_PROPERTY

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

DEFAULT_NAME_PROPERTY

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

SPECIFIED_SECONDARY_TABLES_LIST

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

DEFAULT_INHERITANCE_STRATEGY_PROPERTY

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

SPECIFIED_INHERITANCE_STRATEGY_PROPERTY

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

DEFAULT_DISCRIMINATOR_VALUE_PROPERTY

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

SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY

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

SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY

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

DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY

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

SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY

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

DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY

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

SPECIFIED_TABLE_IS_ALLOWED_PROPERTY

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

TABLE_IS_UNDEFINED_PROPERTY

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

SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST

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

DEFAULT_PRIMARY_KEY_JOIN_COLUMN

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

getName

java.lang.String getName()
Return the name, specified or default if not specified.


getSpecifiedName

java.lang.String getSpecifiedName()
Return the specified name.


setSpecifiedName

void setSpecifiedName(java.lang.String value)
Set the specified name on the entity.


getDefaultName

java.lang.String getDefaultName()
Return the default name, based on the class name.


getIdClassReference

IdClassReference getIdClassReference()
Return the (aggregate) class reference for configuring and validating id class


getTable

Table getTable()
Return the table for this entity, either specified or default. This will not be null.


getPrimaryKeyColumnName

java.lang.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

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


getDefaultSchema

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


getDefaultCatalog

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


secondaryTables

<T extends SecondaryTable> java.util.ListIterator<T> secondaryTables()
Return a list iterator of the secondary tables whether specified or default. This will not be null.


secondaryTablesSize

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


specifiedSecondaryTables

<T extends SecondaryTable> java.util.ListIterator<T> specifiedSecondaryTables()
Return a list iterator of the specified secondary tables. This will not be null.


specifiedSecondaryTablesSize

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


addSpecifiedSecondaryTable

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


addSpecifiedSecondaryTable

SecondaryTable addSpecifiedSecondaryTable()
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(SecondaryTable 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()

getDefaultInheritanceStrategy

InheritanceType getDefaultInheritanceStrategy()

getSpecifiedInheritanceStrategy

InheritanceType getSpecifiedInheritanceStrategy()

setSpecifiedInheritanceStrategy

void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType)

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

DiscriminatorColumn getDiscriminatorColumn()

getDiscriminatorValue

java.lang.String getDiscriminatorValue()

getDefaultDiscriminatorValue

java.lang.String getDefaultDiscriminatorValue()

getSpecifiedDiscriminatorValue

java.lang.String getSpecifiedDiscriminatorValue()

setSpecifiedDiscriminatorValue

void setSpecifiedDiscriminatorValue(java.lang.String value)

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


primaryKeyJoinColumns

<T extends PrimaryKeyJoinColumn> java.util.ListIterator<T> primaryKeyJoinColumns()

primaryKeyJoinColumnsSize

int primaryKeyJoinColumnsSize()

specifiedPrimaryKeyJoinColumns

<T extends PrimaryKeyJoinColumn> java.util.ListIterator<T> specifiedPrimaryKeyJoinColumns()

specifiedPrimaryKeyJoinColumnsSize

int specifiedPrimaryKeyJoinColumnsSize()

getDefaultPrimaryKeyJoinColumn

PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn()

addSpecifiedPrimaryKeyJoinColumn

PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)

removeSpecifiedPrimaryKeyJoinColumn

void removeSpecifiedPrimaryKeyJoinColumn(int index)

removeSpecifiedPrimaryKeyJoinColumn

void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn)

moveSpecifiedPrimaryKeyJoinColumn

void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex,
                                       int sourceIndex)

getAttributeOverrideContainer

AttributeOverrideContainer getAttributeOverrideContainer()

getAssociationOverrideContainer

AssociationOverrideContainer getAssociationOverrideContainer()

getQueryContainer

QueryContainer getQueryContainer()

getGeneratorContainer

GeneratorContainer getGeneratorContainer()

isRoot

boolean isRoot()
Return whether this entity is a root entity in an inheritance hierarchy


getRootEntity

Entity getRootEntity()
Return the ultimate top of the inheritance hierarchy This method should never return null. The root is defined as the persistent type in the inheritance hierarchy that has no parent. The root should be an entity Non-entities in the hierarchy should be ignored, ie skip over them in the search for the root.


addSubEntity

void addSubEntity(Entity subEntity)
The given Entity has this entity as its root entity, add it as a sub entity.

See Also:
org.eclipse.jpt.core.context.persistence.PersistenceUnit#addRootWithSubEntities(String)

resolveAttributeMapping

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


getIdAttribute

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