Dali Provisional API
Release 3.2

org.eclipse.jpt.jpa.core.context.orm
Interface OrmPersistentType

All Superinterfaces:
AccessReference, DeleteTypeRefactoringParticipant, IAdaptable, JpaContextModel, JpaModel, JpaStructureNode, JptResourceTypeReference, ManagedType, Model, OrmManagedType, PersistentType, SpecifiedAccessReference, TypeRefactoringParticipant
All Known Subinterfaces:
EclipseLinkOrmPersistentType

public interface OrmPersistentType
extends OrmManagedType, PersistentType

orm.xml persistent type

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
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant
DeleteTypeRefactoringParticipant.DeleteTypeEditsTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant
TypeRefactoringParticipant.MoveTypeEditsTransformer, TypeRefactoringParticipant.RenamePackageEditsTransformer, TypeRefactoringParticipant.RenameTypeEditsTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.PersistentType
PersistentType.AttributesTransformer, PersistentType.Config, PersistentType.MappingTransformer, PersistentType.OverriddenPersistentTypeTransformer, PersistentType.Parent
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.context.ManagedType
ManagedType.NameTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
JpaStructureNode.ContextType
 
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_ATTRIBUTES_LIST
           
static String SPECIFIED_ATTRIBUTES_LIST
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.orm.OrmManagedType
CLASS_PROPERTY, JAVA_MANAGED_TYPE_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.PersistentType
ATTRIBUTES_TRANSFORMER, MAPPING_PROPERTY, MAPPING_TRANSFORMER, OVERRIDDEN_PERSISTENT_TYPE_TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.ManagedType
NAME_PROPERTY, NAME_TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
STRUCTURE_CHILDREN_COLLECTION
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference
DEFAULT_ACCESS_PROPERTY, SPECIFIED_ACCESS_PROPERTY
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
TRANSFORMER
 
Method Summary
 OrmSpecifiedPersistentAttribute addAttributeToXml(OrmPersistentAttribute virtualAttribute)
          Add the specified persistent attribute to the orm.xml.
 OrmSpecifiedPersistentAttribute addAttributeToXml(OrmPersistentAttribute virtualAttribute, String mappingKey)
          Add the specified persistent attribute to the orm.xml with the specified mapping.
 void changeMapping(OrmSpecifiedPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping)
          This is called whenever the specified persistent attribute's mapping is changed as specified.
 OrmPersistentAttribute getAttributeNamed(String attributeName)
          Return the persistent attribute with the specified name, if it exists locally on the persistent type (as opposed to in its inheritance hierarchy).
 org.eclipse.jpt.common.utility.iterable.ListIterable<OrmPersistentAttribute> getAttributes()
          Return a combination of the persistent type's specified and default attributes.
 org.eclipse.jpt.common.utility.iterable.ListIterable<OrmPersistentAttribute> getDefaultAttributes()
          Return default orm.xml persistent attributes.
 int getDefaultAttributesSize()
          Return the number of default orm.xml persistent attributes.
 JavaPersistentType getJavaPersistentType()
          Return the Java persistent type that is referred to by the orm.xml persistent type.
 OrmTypeMapping getMapping()
          Return the persistent type's mapping.
 org.eclipse.jpt.common.utility.iterable.ListIterable<OrmSpecifiedPersistentAttribute> getSpecifiedAttributes()
          Return the persistent type's specified attributes.
 int getSpecifiedAttributesSize()
          Return the number of the persistent type's specified attributes.
 Class<OrmPersistentType> getStructureType()
          Return the structure node's type.
 org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping getXmlManagedType()
           
 OrmPersistentAttribute removeAttributeFromXml(OrmSpecifiedPersistentAttribute specifiedAttribute)
          Remove attribute from the type's list of specified attributes and remove it from the orm.xml file.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.orm.OrmManagedType
addXmlManagedTypeTo, dispose, getClass_, getDefaultPackage, getJavaManagedType, getParent, getXmlSequence, removeXmlManagedTypeFrom, setClass
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant
createDeleteTypeEdits
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant
createMoveTypeEdits, createRenamePackageEdits, createRenameTypeEdits
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.PersistentType
getAllAttributeNames, getAllAttributes, getAncestors, getAttributeNames, getAttributesSize, getAttributeTypeBinding, getInheritanceHierarchy, getManagedTypeType, getMappingKey, getOverriddenPersistentType, getSuperPersistentType, isMapped, resolveAttribute, setMappingKey
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.ManagedType
getJavaResourceType, getName, getSimpleName, getTypeQualifiedName, isFor, isIn
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
addRootStructureNodesTo, containsOffset, getContextType, getFullTextRange, getSelectionTextRange, getStructureChildren, getStructureChildrenSize, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference
getDefaultAccess, getSpecifiedAccess, setSpecifiedAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.AccessReference
getAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextModel
getCompletionProposals, getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, 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_ATTRIBUTES_LIST

static final String SPECIFIED_ATTRIBUTES_LIST
See Also:
Constant Field Values

DEFAULT_ATTRIBUTES_LIST

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

getStructureType

Class<OrmPersistentType> getStructureType()
Description copied from interface: JpaStructureNode
Return the structure node's type. This is used to find the appropriate UI provider for building the structure node's JPA Details page.

Specified by:
getStructureType in interface JpaStructureNode

getXmlManagedType

org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping getXmlManagedType()
Specified by:
getXmlManagedType in interface OrmManagedType

getMapping

OrmTypeMapping getMapping()
Description copied from interface: PersistentType
Return the persistent type's mapping. Set the mapping via PersistentType.setMappingKey(String).

Specified by:
getMapping in interface PersistentType

getAttributes

org.eclipse.jpt.common.utility.iterable.ListIterable<OrmPersistentAttribute> getAttributes()
Return a combination of the persistent type's specified and default attributes. The specified attributes are those explicitly listed in the orm.xml file; while the default attributes are those derived from the corresponding Java persistent type.

Specified by:
getAttributes in interface PersistentType

getAttributeNamed

OrmPersistentAttribute getAttributeNamed(String attributeName)
Description copied from interface: PersistentType
Return the persistent attribute with the specified name, if it exists locally on the persistent type (as opposed to in its inheritance hierarchy).

Specified by:
getAttributeNamed in interface PersistentType

getSpecifiedAttributes

org.eclipse.jpt.common.utility.iterable.ListIterable<OrmSpecifiedPersistentAttribute> getSpecifiedAttributes()
Return the persistent type's specified attributes.


getSpecifiedAttributesSize

int getSpecifiedAttributesSize()
Return the number of the persistent type's specified attributes.


getDefaultAttributes

org.eclipse.jpt.common.utility.iterable.ListIterable<OrmPersistentAttribute> getDefaultAttributes()
Return default orm.xml persistent attributes. These are attributes that exist in the corresponding Java class, but are not specified in the orm.xml.


getDefaultAttributesSize

int getDefaultAttributesSize()
Return the number of default orm.xml persistent attributes.

See Also:
getDefaultAttributes()

removeAttributeFromXml

OrmPersistentAttribute removeAttributeFromXml(OrmSpecifiedPersistentAttribute specifiedAttribute)
Remove attribute from the type's list of specified attributes and remove it from the orm.xml file. Return the new (virtual) attribute, if it exists. Return null if the specified attribute does not correspond to an attribute in the Java persistent type.

Throw an IllegalArgumentException if the attribute is virtual

See Also:
OrmSpecifiedPersistentAttribute.removeFromXml(), PersistentAttribute.isVirtual()

addAttributeToXml

OrmSpecifiedPersistentAttribute addAttributeToXml(OrmPersistentAttribute virtualAttribute)
Add the specified persistent attribute to the orm.xml. The attribute will be added to the orm.xml and moved from the list of default attributes to the list of specified attributes. It will keep the same mapping it had, either specified in a Java annotation or the default.

Throw an IllegalArgumentException if the attribute is already specified.

See Also:
OrmPersistentAttribute.addToXml()

addAttributeToXml

OrmSpecifiedPersistentAttribute addAttributeToXml(OrmPersistentAttribute virtualAttribute,
                                                  String mappingKey)
Add the specified persistent attribute to the orm.xml with the specified mapping. The attribute will be added to the orm.xml and moved from the list of default attributes to the list of specified attributes.

Throw an IllegalArgumentException if the attribute is already specified.

See Also:
OrmPersistentAttribute.addToXml(String)

changeMapping

void changeMapping(OrmSpecifiedPersistentAttribute ormPersistentAttribute,
                   OrmAttributeMapping oldMapping,
                   OrmAttributeMapping newMapping)
This is called whenever the specified persistent attribute's mapping is changed as specified.


getJavaPersistentType

JavaPersistentType getJavaPersistentType()
Return the Java persistent type that is referred to by the orm.xml persistent type. Return null if it is missing.

See Also:
OrmManagedType.getJavaManagedType()

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.