Package com.sap.cds.reflect
Interface CdsAssociationType
- All Superinterfaces:
CdsAnnotatable
,CdsDefinition
,CdsNamed
,CdsType
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
accept
(CdsVisitor visitor) Accepts aCdsVisitor
visiting the elements of this definition (depth-first)Returns theCdsAssociationType.Cardinality
of thisCdsAssociation
.default String
Returns the fully qualified name of this definition.Returns the targetCdsEntity
of thisCdsAssociation
.default boolean
Returnstrue
if this is an association type.boolean
Returnstrue
if this is a composition.Returns anOptional
wrapping the on condition of this association.refs()
Returns a sequentialStream
ofelement refs
that are used to identify thetarget entity
of this association.Methods inherited from interface com.sap.cds.reflect.CdsAnnotatable
annotations, findAnnotation, getAnnotationValue, getDoc
Methods inherited from interface com.sap.cds.reflect.CdsDefinition
as, getKey, getKind, getName, getQualifier
Methods inherited from interface com.sap.cds.reflect.CdsType
isArrayed, isEnum, isSimple, isSimpleType, isStructured, isSymbolicType
-
Method Details
-
getTarget
CdsEntity getTarget()Returns the targetCdsEntity
of thisCdsAssociation
.- Returns:
- the target
CdsEntity
of this association, notnull
-
getTargetAspect
Optional<CdsStructuredType> getTargetAspect()Returns anOptional
wrapping the target Aspect'sCdsType
provided this is a composition that targets an aspect.- Returns:
Optional
holding the target aspect'sCdsType
if this is a composition of aspects, or an emptyOptional
otherwise
-
getCardinality
CdsAssociationType.Cardinality getCardinality()Returns theCdsAssociationType.Cardinality
of thisCdsAssociation
.- Returns:
- the
Cardinality
of this association, notnull
-
isComposition
boolean isComposition()Returnstrue
if this is a composition.- Returns:
true
if this is a composition, otherwisefalse
-
refs
Stream<CqnElementRef> refs()Returns a sequentialStream
ofelement refs
that are used to identify thetarget entity
of this association. This is only supported for managed to-one associations.- Returns:
- a
Stream
of the referenced target entity elements, or an empty stream for unmanaged and to-many associations.
-
onCondition
Optional<CqnPredicate> onCondition()Returns anOptional
wrapping the on condition of this association.- Returns:
- an
Optional
describing the on condition of this association, or an emptyOptional
if this association has no on condition - See Also:
-
isAssociation
default boolean isAssociation()Description copied from interface:CdsType
Returnstrue
if this is an association type.- Specified by:
isAssociation
in interfaceCdsType
- Returns:
true
if this is an association type, otherwisefalse
-
getQualifiedName
Description copied from interface:CdsDefinition
Returns the fully qualified name of this definition.- Specified by:
getQualifiedName
in interfaceCdsDefinition
- Returns:
- the fully qualified name of this definition
-
accept
Description copied from interface:CdsDefinition
Accepts aCdsVisitor
visiting the elements of this definition (depth-first)- Specified by:
accept
in interfaceCdsDefinition
- Parameters:
visitor
- theCdsVisitor
-