org.eclipse.jpt.core.context.orm
Interface OrmEntity

All Superinterfaces:
Entity, GeneratorHolder, org.eclipse.core.runtime.IAdaptable, IdClass, JpaContextNode, JpaNode, Model, OrmGeneratorHolder, OrmJpaContextNode, OrmTypeMapping, QueryHolder, TypeMapping

public interface OrmEntity
extends OrmTypeMapping, Entity, OrmGeneratorHolder

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_PRIMARY_KEY_JOIN_COLUMNS_LIST
           
static java.lang.String VIRTUAL_SECONDARY_TABLES_LIST
           
 
Fields inherited from interface org.eclipse.jpt.core.context.orm.OrmTypeMapping
CLASS_PROPERTY, DEFAULT_ACCESS_PROPERTY, DEFAULT_METADATA_COMPLETE_PROPERTY, JAVA_PERSISTENT_TYPE_PROPERTY, SPECIFIED_ACCESS_PROPERTY, SPECIFIED_METADATA_COMPLETE_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.core.context.Entity
DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, DEFAULT_INHERITANCE_STRATEGY_PROPERTY, DEFAULT_NAME_PROPERTY, DEFAULT_PRIMARY_KEY_JOIN_COLUMN, DISCRIMINATOR_VALUE_ALLOWED_PROPERTY, SPECIFIED_ASSOCIATION_OVERRIDES_LIST, SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, SPECIFIED_NAME_PROPERTY, SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, SPECIFIED_SECONDARY_TABLES_LIST, VIRTUAL_ASSOCIATION_OVERRIDES_LIST, 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
 
Fields inherited from interface org.eclipse.jpt.core.context.GeneratorHolder
SEQUENCE_GENERATOR_PROPERTY, TABLE_GENERATOR_PROPERTY
 
Method Summary
 OrmNamedNativeQuery addNamedNativeQuery(int index)
          Add a named native query to the entity return the object representing it.
 OrmNamedQuery addNamedQuery(int index)
          Add a named query to the entity return the object representing it.
 OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)
           
 OrmSecondaryTable addSpecifiedSecondaryTable(int index)
          Add a specified secondary table to the entity return the object representing it.
 java.util.ListIterator<OrmAssociationOverride> associationOverrides()
          Return a list iterator of the association overrides whether specified or default.
 java.util.ListIterator<OrmAttributeOverride> attributeOverrides()
          Return a list iterator of the attribute overrides whether specified or default.
 boolean containsVirtualSecondaryTable(OrmSecondaryTable secondaryTable)
          Return whether the entity contains the given secondary table in its list of virtual secondary tables
 java.util.ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns()
           
 OrmAttributeOverride getAttributeOverrideNamed(java.lang.String name)
          Return the attribute overrides, whether specified or default, with the given name.
 OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn()
           
 OrmDiscriminatorColumn getDiscriminatorColumn()
           
 JavaEntity getJavaEntity()
          Return the Java Entity this ORM Entity corresponds to.
 OrmTable getTable()
          Return the table for this entity, either specified or default.
 void initialize(XmlEntity entity)
           
 java.util.ListIterator<OrmNamedNativeQuery> namedNativeQueries()
          Return a list iterator of the specified named native queries.
 java.util.ListIterator<OrmNamedQuery> namedQueries()
          Return a list iterator of the named queries.
 java.util.Iterator<OrmPersistentAttribute> overridableAssociations()
          Return an Iterator of associations that can be overriden.
 java.util.Iterator<OrmPersistentAttribute> overridableAttributes()
          Return an Iterator of attributes.
 java.util.ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns()
           
 java.util.ListIterator<OrmSecondaryTable> secondaryTables()
          Return a list iterator of the secondary tables whether specified or default.
 boolean secondaryTablesDefinedInXml()
          Return true if there are no virtual secondary tables on the orm entity.
 void setSecondaryTablesDefinedInXml(boolean defineInXml)
          If true, then all virtual secondary tables are added in as specified secondary tables to the xml.
 java.util.ListIterator<OrmAssociationOverride> specifiedAssociationOverrides()
          Return a list iterator of the specified association overrides.
 java.util.ListIterator<OrmAttributeOverride> specifiedAttributeOverrides()
          Return a list iterator of the specified attribute overrides.
 java.util.ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns()
           
 java.util.ListIterator<OrmSecondaryTable> specifiedSecondaryTables()
          Return a list iterator of the specified secondary tables.
 void update(XmlEntity entity)
           
 java.util.ListIterator<OrmAssociationOverride> virtualAssociationOverrides()
          Return the number of default association overrides.
 java.util.ListIterator<OrmAttributeOverride> virtualAttributeOverrides()
          Return a list iterator of the virtual attribute overrides, those not specified.
 java.util.ListIterator<OrmSecondaryTable> virtualSecondaryTables()
          Return a list iterator of the virtual(not specified) secondary tables.
 int virtualSecondaryTablesSize()
          Return the number of virtual secondary tables.
 
Methods inherited from interface org.eclipse.jpt.core.context.orm.OrmTypeMapping
addToResourceModel, containsOffset, getAccess, getAttributesTextRange, getClass_, getDefaultAccess, getJavaPersistentType, getPersistentType, getSelectionTextRange, getSpecifiedAccess, getSpecifiedMetadataComplete, getTypeMappingResource, getXmlSequence, initializeFrom, isDefaultMetadataComplete, isMetadataComplete, removeFromResourceModel, setClass, setSpecifiedAccess, setSpecifiedMetadataComplete
 
Methods inherited from interface org.eclipse.jpt.core.context.TypeMapping
allOverridableAssociationNames, allOverridableAssociations, allOverridableAttributeNames, allOverridableAttributes, associatedTableNamesIncludingInherited, associatedTables, associatedTablesIncludingInherited, attributeMappingKeyAllowed, getDbSchema, getDbTable, getKey, getPrimaryDbTable, getTableName, isMapped, overridableAssociationNames, overridableAttributeNames, 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.orm.OrmJpaContextNode
addToMessages, getValidationTextRange
 
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.Entity
associationOverridesSize, attributeOverridesSize, getDefaultDiscriminatorValue, getDefaultInheritanceStrategy, getDefaultName, getDiscriminatorValue, getInheritanceStrategy, getName, getParentEntity, getPrimaryKeyColumnName, getRootEntity, getSpecifiedDiscriminatorValue, getSpecifiedInheritanceStrategy, getSpecifiedName, isDiscriminatorValueAllowed, moveSpecifiedAssociationOverride, moveSpecifiedAttributeOverride, moveSpecifiedPrimaryKeyJoinColumn, moveSpecifiedSecondaryTable, primaryKeyJoinColumnsSize, removeSpecifiedPrimaryKeyJoinColumn, removeSpecifiedPrimaryKeyJoinColumn, removeSpecifiedSecondaryTable, removeSpecifiedSecondaryTable, secondaryTablesSize, setSpecifiedDiscriminatorValue, setSpecifiedInheritanceStrategy, setSpecifiedName, specifiedAssociationOverridesSize, specifiedAttributeOverridesSize, specifiedPrimaryKeyJoinColumnsSize, specifiedSecondaryTablesSize, virtualAssociationOverridesSize, virtualAttributeOverridesSize
 
Methods inherited from interface org.eclipse.jpt.core.context.TypeMapping
allOverridableAssociationNames, allOverridableAssociations, allOverridableAttributeNames, allOverridableAttributes, associatedTableNamesIncludingInherited, associatedTables, associatedTablesIncludingInherited, attributeMappingKeyAllowed, getDbSchema, getDbTable, getKey, getPrimaryDbTable, getTableName, isMapped, overridableAssociationNames, overridableAttributeNames, 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
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
moveNamedNativeQuery, moveNamedQuery, namedNativeQueriesSize, 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
 
Methods inherited from interface org.eclipse.jpt.core.context.orm.OrmGeneratorHolder
addSequenceGenerator, addTableGenerator, getSequenceGenerator, getTableGenerator
 
Methods inherited from interface org.eclipse.jpt.core.context.GeneratorHolder
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
 

Field Detail

VIRTUAL_SECONDARY_TABLES_LIST

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

DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST

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

virtualSecondaryTables

java.util.ListIterator<OrmSecondaryTable> virtualSecondaryTables()
Return a list iterator of the virtual(not specified) secondary tables. This will not be null.


virtualSecondaryTablesSize

int virtualSecondaryTablesSize()
Return the number of virtual secondary tables.


containsVirtualSecondaryTable

boolean containsVirtualSecondaryTable(OrmSecondaryTable secondaryTable)
Return whether the entity contains the given secondary table in its list of virtual secondary tables


secondaryTablesDefinedInXml

boolean secondaryTablesDefinedInXml()
Return true if there are no virtual secondary tables on the orm entity. This is used to determine whether you can add specified secondary tables. You must first make sure all virtual secondary tables have been specified in xml before adding more. This is because adding one secondary table to xml will override all the secondary tables specified in the java entity


setSecondaryTablesDefinedInXml

void setSecondaryTablesDefinedInXml(boolean defineInXml)
If true, then all virtual secondary tables are added in as specified secondary tables to the xml. If false, then all the specified secondary tables are remvoed from the xml.


getJavaEntity

JavaEntity getJavaEntity()
Return the Java Entity this ORM Entity corresponds to. Return null if there is no java entity.


initialize

void initialize(XmlEntity entity)

update

void update(XmlEntity entity)

getTable

OrmTable getTable()
Description copied from interface: Entity
Return the table for this entity, either specified or default. This will not be null.

Specified by:
getTable in interface Entity

getDiscriminatorColumn

OrmDiscriminatorColumn getDiscriminatorColumn()
Specified by:
getDiscriminatorColumn in interface Entity

secondaryTables

java.util.ListIterator<OrmSecondaryTable> secondaryTables()
Description copied from interface: Entity
Return a list iterator of the secondary tables whether specified or default. This will not be null.

Specified by:
secondaryTables in interface Entity

specifiedSecondaryTables

java.util.ListIterator<OrmSecondaryTable> specifiedSecondaryTables()
Description copied from interface: Entity
Return a list iterator of the specified secondary tables. This will not be null.

Specified by:
specifiedSecondaryTables in interface Entity

addSpecifiedSecondaryTable

OrmSecondaryTable addSpecifiedSecondaryTable(int index)
Description copied from interface: Entity
Add a specified secondary table to the entity return the object representing it.

Specified by:
addSpecifiedSecondaryTable in interface Entity

primaryKeyJoinColumns

java.util.ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns()
Specified by:
primaryKeyJoinColumns in interface Entity

getDefaultPrimaryKeyJoinColumn

OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn()
Specified by:
getDefaultPrimaryKeyJoinColumn in interface Entity

defaultPrimaryKeyJoinColumns

java.util.ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns()

specifiedPrimaryKeyJoinColumns

java.util.ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns()
Specified by:
specifiedPrimaryKeyJoinColumns in interface Entity

addSpecifiedPrimaryKeyJoinColumn

OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index)
Specified by:
addSpecifiedPrimaryKeyJoinColumn in interface Entity

attributeOverrides

java.util.ListIterator<OrmAttributeOverride> attributeOverrides()
Description copied from interface: Entity
Return a list iterator of the attribute overrides whether specified or default. This will not be null.

Specified by:
attributeOverrides in interface Entity

specifiedAttributeOverrides

java.util.ListIterator<OrmAttributeOverride> specifiedAttributeOverrides()
Description copied from interface: Entity
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

Specified by:
specifiedAttributeOverrides in interface Entity

virtualAttributeOverrides

java.util.ListIterator<OrmAttributeOverride> virtualAttributeOverrides()
Description copied from interface: Entity
Return a list iterator of the virtual attribute overrides, those not specified. This will not be null.

Specified by:
virtualAttributeOverrides in interface Entity

getAttributeOverrideNamed

OrmAttributeOverride getAttributeOverrideNamed(java.lang.String name)
Description copied from interface: Entity
Return the attribute overrides, whether specified or default, with the given name.

Specified by:
getAttributeOverrideNamed in interface Entity

associationOverrides

java.util.ListIterator<OrmAssociationOverride> associationOverrides()
Description copied from interface: Entity
Return a list iterator of the association overrides whether specified or default. This will not be null.

Specified by:
associationOverrides in interface Entity

specifiedAssociationOverrides

java.util.ListIterator<OrmAssociationOverride> specifiedAssociationOverrides()
Description copied from interface: Entity
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

Specified by:
specifiedAssociationOverrides in interface Entity

virtualAssociationOverrides

java.util.ListIterator<OrmAssociationOverride> virtualAssociationOverrides()
Description copied from interface: Entity
Return the number of default association overrides.

Specified by:
virtualAssociationOverrides in interface Entity

namedQueries

java.util.ListIterator<OrmNamedQuery> namedQueries()
Description copied from interface: QueryHolder
Return a list iterator of the named queries. This will not be null.

Specified by:
namedQueries in interface QueryHolder

addNamedQuery

OrmNamedQuery addNamedQuery(int index)
Description copied from interface: QueryHolder
Add a named query to the entity return the object representing it.

Specified by:
addNamedQuery in interface QueryHolder

namedNativeQueries

java.util.ListIterator<OrmNamedNativeQuery> namedNativeQueries()
Description copied from interface: QueryHolder
Return a list iterator of the specified named native queries. This will not be null.

Specified by:
namedNativeQueries in interface QueryHolder

addNamedNativeQuery

OrmNamedNativeQuery addNamedNativeQuery(int index)
Description copied from interface: QueryHolder
Add a named native query to the entity return the object representing it.

Specified by:
addNamedNativeQuery in interface QueryHolder

overridableAttributes

java.util.Iterator<OrmPersistentAttribute> overridableAttributes()
Description copied from interface: TypeMapping
Return an Iterator of attributes. The attributes must be BasicMappings or IdMappings found in this type mapping

Specified by:
overridableAttributes in interface OrmTypeMapping
Specified by:
overridableAttributes in interface TypeMapping

overridableAssociations

java.util.Iterator<OrmPersistentAttribute> overridableAssociations()
Description copied from interface: TypeMapping
Return an Iterator of associations that can be overriden. The associations must be OneToOneMappings or ManyToOneMappings found in this type mapping

Specified by:
overridableAssociations in interface OrmTypeMapping
Specified by:
overridableAssociations in interface TypeMapping