org.eclipse.jpt.core.context.persistence
Interface MappingFileRef

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, Model, PersistentTypeContainer, XmlContextNode

public interface MappingFileRef
extends XmlContextNode, JpaStructureNode, PersistentTypeContainer

Context model corresponding to the XML resource model XmlMappingFileRef, which corresponds to the mapping-file element in the persistence.xml file.

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 FILE_NAME_PROPERTY
          String constant associated with changes to the file name.
static java.lang.String MAPPING_FILE_PROPERTY
          String constant associated with changes to the mapping file.
 
Method Summary
 boolean containsOffset(int textOffset)
          Return whether the specified text offset is within the text representation of the mapping file.
 java.lang.String getFileName()
          Return the file name of the mapping file ref.
 MappingFile getMappingFile()
          Return mapping file corresponding to the mapping file ref's file name.
 MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults()
          Return the mapping file's persistence unit defaults.
 PersistentType getPersistentType(java.lang.String typeName)
          Return the persistent type, as listed in the mapping file, with the specified name.
 boolean isImplied()
          Return whether the mapping file ref is "implied" by, or explicitly specified in, the persistence.xml.
 boolean persistenceUnitDefaultsExists()
          Return whether the mapping file's persistence unit defaults exist.
 void setFileName(java.lang.String fileName)
          Set the file name of the mapping file ref.
 void update(XmlMappingFileRef mappingFileRef)
          Update the mapping file ref context model to match the specified resource model.
 
Methods inherited from interface org.eclipse.jpt.core.context.XmlContextNode
getValidationTextRange, validate
 
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
 
Methods inherited from interface org.eclipse.jpt.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.core.context.persistence.PersistentTypeContainer
getPersistentTypes
 

Field Detail

FILE_NAME_PROPERTY

static final java.lang.String FILE_NAME_PROPERTY
String constant associated with changes to the file name.

See Also:
Constant Field Values

MAPPING_FILE_PROPERTY

static final java.lang.String MAPPING_FILE_PROPERTY
String constant associated with changes to the mapping file.

See Also:
Constant Field Values
Method Detail

getFileName

java.lang.String getFileName()
Return the file name of the mapping file ref.


setFileName

void setFileName(java.lang.String fileName)
Set the file name of the mapping file ref.


getMappingFile

MappingFile getMappingFile()
Return mapping file corresponding to the mapping file ref's file name.


update

void update(XmlMappingFileRef mappingFileRef)
Update the mapping file ref context model to match the specified resource model. The refs are ordered within the persistence.xml file, so they are updated sequentially, in place, not matched up by name (i.e. the resource model can change).

See Also:
JpaProject.update()

isImplied

boolean isImplied()
Return whether the mapping file ref is "implied" by, or explicitly specified in, the persistence.xml.


getPersistenceUnitDefaults

MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults()
Return the mapping file's persistence unit defaults.


persistenceUnitDefaultsExists

boolean persistenceUnitDefaultsExists()
Return whether the mapping file's persistence unit defaults exist.


getPersistentType

PersistentType getPersistentType(java.lang.String typeName)
Return the persistent type, as listed in the mapping file, with the specified name. Return null if it does not exists.


containsOffset

boolean containsOffset(int textOffset)
Return whether the specified text offset is within the text representation of the mapping file.