org.eclipse.jpt.core.context
Interface Entity

All Superinterfaces:
GeneratorHolder, org.eclipse.core.runtime.IAdaptable, IdClass, JpaContextNode, JpaNode, Model, QueryHolder, TypeMapping
All Known Subinterfaces:
JavaEntity, OrmEntity

public interface Entity
extends TypeMapping, GeneratorHolder, QueryHolder, IdClass

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 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_VALUE_ALLOWED_PROPERTY
           
static java.lang.String SPECIFIED_ASSOCIATION_OVERRIDES_LIST
           
static java.lang.String SPECIFIED_ATTRIBUTE_OVERRIDES_LIST
           
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 VIRTUAL_ASSOCIATION_OVERRIDES_LIST
           
static java.lang.String VIRTUAL_ATTRIBUTE_OVERRIDES_LIST
           
 
Fields inherited from interface org.eclipse.jpt.core.context.GeneratorHolder
SEQUENCE_GENERATOR_PROPERTY, TABLE_GENERATOR_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.core.context.QueryHolder
NAMED_NATIVE_QUERIES_LIST, NAMED_QUERIES_LIST
 
Fields inherited from interface org.eclipse.jpt.core.context.IdClass
ID_CLASS_PROPERTY
 
Method Summary
 PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)
           
 SecondaryTable addSpecifiedSecondaryTable(int index)
          Add a specified secondary table to the entity return the object representing it.
<T extends AssociationOverride>
java.util.ListIterator<T>
associationOverrides()
          Return a list iterator of the association overrides whether specified or default.
 int associationOverridesSize()
          Return the number of association overrides, both specified and default.
<T extends AttributeOverride>
java.util.ListIterator<T>
attributeOverrides()
          Return a list iterator of the attribute overrides whether specified or default.
 int attributeOverridesSize()
          Return the number of attribute overrides, both specified and default.
 AttributeOverride getAttributeOverrideNamed(java.lang.String name)
          Return the attribute overrides, whether specified or default, with the given name.
 java.lang.String getDefaultDiscriminatorValue()
           
 InheritanceType getDefaultInheritanceStrategy()
           
 java.lang.String getDefaultName()
          Return the default name, based on the class name.
 PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn()
           
 DiscriminatorColumn getDiscriminatorColumn()
           
 java.lang.String getDiscriminatorValue()
           
 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.
 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 isDiscriminatorValueAllowed()
          Return whether a DiscriminatorValue is allowed for this Entity It is allowed if the IType is concrete (not abstract)
 void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex)
          Move the specified association override from the source index to the target index.
 void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex)
          Move the specified attribute override from the source index to the target index.
 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.
<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.
<T extends AssociationOverride>
java.util.ListIterator<T>
specifiedAssociationOverrides()
          Return a list iterator of the specified association overrides.
 int specifiedAssociationOverridesSize()
          Return the number of specified association overrides.
<T extends AttributeOverride>
java.util.ListIterator<T>
specifiedAttributeOverrides()
          Return a list iterator of the specified attribute overrides.
 int specifiedAttributeOverridesSize()
          Return the number of specified attribute overrides.
<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.
<T extends AssociationOverride>
java.util.ListIterator<T>
virtualAssociationOverrides()
          Return the number of default association overrides.
 int virtualAssociationOverridesSize()
          Return the number of default association overrides.
<T extends AttributeOverride>
java.util.ListIterator<T>
virtualAttributeOverrides()
          Return a list iterator of the virtual attribute overrides, those not specified.
 int virtualAttributeOverridesSize()
          Return the number of default attribute overrides.
 
Methods inherited from interface org.eclipse.jpt.core.context.TypeMapping
allOverridableAssociationNames, allOverridableAssociations, allOverridableAttributeNames, allOverridableAttributes, associatedTableNamesIncludingInherited, associatedTables, associatedTablesIncludingInherited, attributeMappingKeyAllowed, getDbSchema, getDbTable, getKey, getPersistentType, getPrimaryDbTable, getTableName, isMapped, overridableAssociationNames, overridableAssociations, overridableAttributeNames, overridableAttributes, tableNameIsInvalid
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getEntityMappings, getOrmPersistentType, getPersistenceUnit
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent, getResource
 
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.context.GeneratorHolder
addSequenceGenerator, addTableGenerator, getSequenceGenerator, getTableGenerator, removeSequenceGenerator, removeTableGenerator
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getEntityMappings, getOrmPersistentType, getPersistenceUnit
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent, getResource
 
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.context.QueryHolder
addNamedNativeQuery, addNamedQuery, moveNamedNativeQuery, moveNamedQuery, namedNativeQueries, namedNativeQueriesSize, namedQueries, namedQueriesSize, removeNamedNativeQuery, removeNamedNativeQuery, removeNamedQuery, removeNamedQuery
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getEntityMappings, getOrmPersistentType, getPersistenceUnit
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent, getResource
 
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.context.IdClass
getIdClass, setIdClass
 
Methods inherited from interface org.eclipse.jpt.core.context.JpaContextNode
getEntityMappings, getOrmPersistentType, getPersistenceUnit
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent, getResource
 
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
 

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

DISCRIMINATOR_VALUE_ALLOWED_PROPERTY

static final java.lang.String DISCRIMINATOR_VALUE_ALLOWED_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

SPECIFIED_ATTRIBUTE_OVERRIDES_LIST

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

VIRTUAL_ATTRIBUTE_OVERRIDES_LIST

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

SPECIFIED_ASSOCIATION_OVERRIDES_LIST

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

VIRTUAL_ASSOCIATION_OVERRIDES_LIST

static final java.lang.String VIRTUAL_ASSOCIATION_OVERRIDES_LIST
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.


getTable

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


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.


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)

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)

isDiscriminatorValueAllowed

boolean isDiscriminatorValueAllowed()
Return whether a DiscriminatorValue is allowed for this Entity It is allowed if the IType is concrete (not abstract)


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)

attributeOverrides

<T extends AttributeOverride> java.util.ListIterator<T> attributeOverrides()
Return a list iterator of the attribute overrides whether specified or default. This will not be null.


attributeOverridesSize

int attributeOverridesSize()
Return the number of attribute overrides, both specified and default.


specifiedAttributeOverrides

<T extends AttributeOverride> java.util.ListIterator<T> specifiedAttributeOverrides()
Return a list iterator of the specified attribute overrides. This will not be null. No add/remove for specified attribute overrides, the virtual attribute overrides will be populated from superclasses, then use AttributeOverride.setVirtual(boolean) to add/remove the attribute override from the source


specifiedAttributeOverridesSize

int specifiedAttributeOverridesSize()
Return the number of specified attribute overrides.


virtualAttributeOverrides

<T extends AttributeOverride> java.util.ListIterator<T> virtualAttributeOverrides()
Return a list iterator of the virtual attribute overrides, those not specified. This will not be null.


virtualAttributeOverridesSize

int virtualAttributeOverridesSize()
Return the number of default attribute overrides.


moveSpecifiedAttributeOverride

void moveSpecifiedAttributeOverride(int targetIndex,
                                    int sourceIndex)
Move the specified attribute override from the source index to the target index.


getAttributeOverrideNamed

AttributeOverride getAttributeOverrideNamed(java.lang.String name)
Return the attribute overrides, whether specified or default, with the given name.


associationOverrides

<T extends AssociationOverride> java.util.ListIterator<T> associationOverrides()
Return a list iterator of the association overrides whether specified or default. This will not be null.


associationOverridesSize

int associationOverridesSize()
Return the number of association overrides, both specified and default.


specifiedAssociationOverrides

<T extends AssociationOverride> java.util.ListIterator<T> specifiedAssociationOverrides()
Return a list iterator of the specified association overrides. This will not be null. No add/remove for specified association overrides, the virtual association overrides will be populated from superclasses, then use AssociationOverride.setVirtual(boolean) to add/remove the association override from the source


specifiedAssociationOverridesSize

int specifiedAssociationOverridesSize()
Return the number of specified association overrides.


virtualAssociationOverrides

<T extends AssociationOverride> java.util.ListIterator<T> virtualAssociationOverrides()
Return the number of default association overrides.


virtualAssociationOverridesSize

int virtualAssociationOverridesSize()
Return the number of default association overrides.


moveSpecifiedAssociationOverride

void moveSpecifiedAssociationOverride(int targetIndex,
                                      int sourceIndex)
Move the specified association override from the source index to the target index.


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.


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)


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).