public class RelationType extends ComposedType
Physically these relations are backed by the Link item. Therefore all relation
type instances are subtype of the composed type describing the Link item.
Relation types consists of the source and target (item) type, the source and target type role and a unique relation
name. Since it distinguishes between source and target relation types are directed. The relation
end points are described as RelationDescriptor belonging to source or target
type. This allows accessing a relation as two item collection attributes from both types. Creation and removal
of the actual relation tuples (means Link items) is done automatically. Moreove relations may be localized, which
means there may exist different relation elements per language.
ComposedType.ComposedTypeImplType.TypeImplTypeManagerManaged.TypeManagerManagedImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static String |
LOCALIZATION_ATTRIBUTE |
static String |
LOCALIZED
The localized attribute string constant.
|
static String |
ORDERING_ATTRIBUTE |
static String |
SOURCE_ATTRIBUTE
The source type attribute attribute string constant.
|
static String |
SOURCE_TYPE
The source type attribute string constant.
|
static String |
SOURCE_TYPE_ROLE
The source type role attribute string constant.
|
static String |
TARGET_ATTRIBUTE
The target type attribute attribute string constant.
|
static String |
TARGET_TYPE
The target type attribute string constant.
|
static String |
TARGET_TYPE_ROLE
The target type role attribute string constant.
|
ABSTRACT, ALLSUBTYPES, ALLSUPERTYPES, ATTRIBUTEDESCRIPTORS, DECLAREDATTRIBUTEDESCRIPTORS, DUMPPROPERTYTABLE, DYNAMIC, INHERITANCEPATH, INHERITEDATTRIBUTEDESCRIPTORS, JALOCLASS, JALOONLY, JNDINAME, SINGLETON, SUBTYPES, SUPERTYPE, TABLECODE, DEFAULTVALUE, DESCRIPTION, XMLDEFINITIONAUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATE, NAMELANGUAGE_FALLBACK_ENABLED_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
RelationType() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendModfierXMLDefinition(RelationDescriptor des,
StringBuilder sb)
Internal helper for
getXMLDefinition(). |
protected void |
appendModfierXMLDefinition(RelationDescriptor des,
XMLOutputter xout) |
protected Item |
createItem(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap allAttributes)
|
String |
exportXMLDefinition(XMLOutputter xout) |
AttributeDescriptor |
getLocalizationAttribute()
For 1-n relations only: the attribute which is used to map elements to different languages.
|
protected Item.ItemAttributeMap |
getNonInitialAttributes(SessionContext ctx,
Item.ItemAttributeMap allAttributes)
Removes the following attributes from attribute values map:
Type.CODE
LOCALIZED
SOURCE_ATTRIBUTE
SOURCE_TYPE
SOURCE_TYPE_ROLE
TARGET_ATTRIBUTE
TARGET_TYPE
TARGET_TYPE_ROLE
|
AttributeDescriptor |
getOrderingAttribute()
For 1-n relations only: the attribute which is used to store the element order.
|
RelationDescriptor |
getSourceAttributeDescriptor()
Returns the relation attribute belonging to the source type of this relation.
|
ComposedType |
getSourceType()
Returns the source type of this relation.
|
EnumerationValue |
getSourceTypeCardinality() |
String |
getSourceTypeRole()
Return the role name of the source type within this relation.
|
RelationDescriptor |
getTargetAttributeDescriptor()
Returns the relation attribute belonging to the target type of this relation.
|
ComposedType |
getTargetType()
Returns the target type of this relation.
|
EnumerationValue |
getTargetTypeCardinality() |
String |
getTargetTypeRole()
Return the role name of the target type within this relation.
|
String |
getXMLDefinition()
Assembles the XML definition of this relation to put inside
items.xml . |
boolean |
isLocalized() |
boolean |
isOneToMany() |
boolean |
isOrdered() |
boolean |
isRootRelationType()
Tells whether this relation is a root relation type.
|
boolean |
isSourceNavigable() |
boolean |
isSourceTypeOne() |
boolean |
isTargetNavigable() |
boolean |
isTargetTypeOne() |
_sortAttributesByQualifier, checkItemPermission, checkTypePermission, checkTypePermission, createAttributeDescriptor, createAttributeDescriptor, createJaloOnlyInstance, exportXMLDefinition, getAllConcreteItemTypeCodes, getAllDefaultValues, getAllDefaultValues, getAllInstances, getAllInstances, getAllInstancesCount, getAllSubTypes, getAllSuperTypes, getAttributeDescriptor, getAttributeDescriptorIncludingPrivate, getAttributeDescriptors, getAttributeDescriptorsIncludingPrivate, getAttributeDescriptorsIncludingPrivate, getComposedTypeImpl, getCreatorInstance, getDeclaredAttributeDescriptor, getDeclaredAttributeDescriptors, getDeclaredJaloClass, getDefaultValues, getDefaultValues, getDumpPropertyTable, getEveryAttributeDescriptor, getInheritancePathString, getInheritedAttributeDescriptors, getInitialAttributeDescriptors, getItemTypeCode, getJaloClass, getJNDIName, getPartOfAutoRemovalAttributeDescriptors, getRelations, getSingletonInstance, getSubTypes, getSuperType, getTable, getXMLCustomProperties, getXMLDefinition, hasAttribute, isAbstract, isAssignableFrom, isDynamic, isInstance, isJaloClassAbstract, isJaloOnly, isSameOrSuperTypeOf, isSingleton, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, parseValue, setDeclaredAttributeDescriptors, setJaloClass, setJaloOnly, setSingleton, setTypeSearchSessionContex, toString, toString, unsetTypeSearchContextcompareTo, getAllDescriptions, getAllDescriptions, getCode, getDefaultValue, getDefaultValue, getDescription, getDescription, getTypeImpl, setAllDescriptions, setAllDescriptions, setDefaultValue, setDefaultValue, setDescription, setDescriptiongetAllNames, getAllNames, getExtensionName, getImpl, getName, getName, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerate, setName, setNamegetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, readResolve, refreshRemote, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, useTA, writeReplacegetImplementation, setTenantpublic static final String SOURCE_ATTRIBUTE
This names is the collection attribute which makes the relation accessible from source type.
public static final String TARGET_ATTRIBUTE
This names is the collection attribute which makes the relation accessible from target type.
public static final String ORDERING_ATTRIBUTE
public static final String LOCALIZATION_ATTRIBUTE
public static final String SOURCE_TYPE
public static final String TARGET_TYPE
public static final String SOURCE_TYPE_ROLE
public static final String TARGET_TYPE_ROLE
public static final String LOCALIZED
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
createItem in class ComposedTypectx - the current session context which this item is created withintype - the actual item type ( since subtypes may not provide a own jalo class this may be different from the
type which this method was implemented for )JaloBusinessException - indicates an error during creation - any changes will be rollbackedprotected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
getNonInitialAttributes in class ComposedTypectx - session context with language = NULLallAttributes - a ItemAttributeMap contaning attribute values.ItemAttributeMap containing all attribute values, which belong to non-initial attributes.public String getXMLDefinition()
items.xml .getXMLDefinition in class ComposedTypeComposedType.getXMLDefinition(String)public String exportXMLDefinition(XMLOutputter xout)
exportXMLDefinition in class ComposedTypeprotected void appendModfierXMLDefinition(RelationDescriptor des, StringBuilder sb)
getXMLDefinition().protected void appendModfierXMLDefinition(RelationDescriptor des, XMLOutputter xout) throws IOException
IOExceptionpublic boolean isRootRelationType()
To declare a relation as root the deployment has to be defined in items.xml :
<relation code="MyRelation"
autocreate="true"
generate="false"
localized="false"
deployment="MyRelationDeplpyment">
...
public boolean isLocalized()
public RelationDescriptor getSourceAttributeDescriptor()
AttributeDescriptor and this method returns null.public RelationDescriptor getTargetAttributeDescriptor()
AttributeDescriptor and this method returns null.public boolean isOrdered()
public AttributeDescriptor getOrderingAttribute()
public AttributeDescriptor getLocalizationAttribute()
public String getSourceTypeRole()
public String getTargetTypeRole()
public ComposedType getSourceType()
public ComposedType getTargetType()
public boolean isOneToMany()
public boolean isSourceTypeOne()
public EnumerationValue getSourceTypeCardinality()
public boolean isTargetTypeOne()
public EnumerationValue getTargetTypeCardinality()
public boolean isSourceNavigable()
public boolean isTargetNavigable()
Copyright © 2017 SAP SE. All Rights Reserved.