Interface EntityViewAttributeMapping
- All Known Subinterfaces:
EntityViewMethodAttributeMapping,EntityViewParameterMapping
public interface EntityViewAttributeMapping
Mapping of an entity view attribute.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe behavior of a plural attribute container.static enumThe behavior of a plural attribute element collections. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Comparator<?>>Returns the comparator class, ornullif there none.Returns the behavior of a plural attribute container if the attribute is plural, ornullotherwise.Returns whether to create empty flat views or not.Class<?>Class<?>The attribute's key type, ornullif the attribute type is not a subtype ofMap.Class<?>Returns the attribute type.Returns the mapping of the view declaring this attribute.Returns the default batch size to use for batchedFetchStrategy.SELECTfetching.Returns the behavior of a plural attribute element collection if the attribute is a multi-collection, ornullotherwise.Class<? extends Comparator<?>>Returns the comparator class, ornullif there none.Returns the limit expression.Returns the offset expression.Returns the order by item expressions.booleanReturns whether this attribute is of the plural type.booleanSpecifies whether an updatable entity view type is disallowed for owned *ToOne relationships or not.booleanSpecifies whether elements should be forcefully deduplicated if the element collection allows duplicates or not.booleanSpecifies whether elements should be forcefully deduplicated if the collection allows duplicates or not.voidSets the container behavior toEntityViewAttributeMapping.ContainerBehavior.DEFAULT.voidSets the container behavior toEntityViewAttributeMapping.ContainerBehavior.INDEXED.voidSets the container behavior toEntityViewAttributeMapping.ContainerBehavior.ORDERED.voidsetContainerSorted(Class<? extends Comparator<?>> comparatorClass) Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.SORTEDusing the given comparator class, if given, for sorting.voidsetCreateEmptyFlatViews(Boolean createEmptyFlatViews) Sets whether to create empty flat views.voidsetDefaultBatchSize(Integer defaultBatchSize) Sets the default batch size to use for batchedFetchStrategy.SELECTfetching.voidsetDisallowOwnedUpdatableSubview(boolean disallowOwnedUpdatableSubview) Sets whether an updatable entity view type is disallowed for owned *ToOne relationships or not.voidSets the element collection behavior toEntityViewAttributeMapping.ElementCollectionBehavior.DEFAULT.voidsetElementCollectionForceUniqueness(boolean forceUniqueness) Sets whether elements should be forcefully deduplicated if the element collection allows duplicates or not.voidSets the element collection behavior toEntityViewAttributeMapping.ElementCollectionBehavior.ORDERED.voidsetElementCollectionSorted(Class<? extends Comparator<?>> comparatorClass) Sets the element collection behavior toEntityViewAttributeMapping.ElementCollectionBehavior.SORTEDusing the given comparator class, if given, for sorting.voidsetForceUniqueness(boolean forceUniqueness) Sets whether elements should be forcefully deduplicated if the collection allows duplicates or not.voidSets the limit expression along with the order by expressions.
-
Method Details
-
getDeclaringView
EntityViewMapping getDeclaringView()Returns the mapping of the view declaring this attribute.- Returns:
- The declaring view mapping
-
isCollection
boolean isCollection()Returns whether this attribute is of the plural type.- Returns:
trueif this attribute is of the plural type,falseotherwise
-
getContainerBehavior
EntityViewAttributeMapping.ContainerBehavior getContainerBehavior()Returns the behavior of a plural attribute container if the attribute is plural, ornullotherwise.- Returns:
- The container behavior, or null if attribute is singular
-
setContainerDefault
void setContainerDefault()Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.DEFAULT. -
setContainerIndexed
void setContainerIndexed()Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.INDEXED. -
setContainerOrdered
void setContainerOrdered()Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.ORDERED. -
setContainerSorted
Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.SORTEDusing the given comparator class, if given, for sorting. If none is given, the key/element type is expected to implementComparable.- Parameters:
comparatorClass- The class of the comparator to use for sorting ornull
-
isForceUniqueness
boolean isForceUniqueness()Specifies whether elements should be forcefully deduplicated if the collection allows duplicates or not.- Returns:
- true if uniqueness of element should be forced, false otherwise
- Since:
- 1.3.0
-
setForceUniqueness
void setForceUniqueness(boolean forceUniqueness) Sets whether elements should be forcefully deduplicated if the collection allows duplicates or not.- Parameters:
forceUniqueness- true if uniqueness of element should be forced, false otherwise- Since:
- 1.3.0
-
getElementCollectionBehavior
EntityViewAttributeMapping.ElementCollectionBehavior getElementCollectionBehavior()Returns the behavior of a plural attribute element collection if the attribute is a multi-collection, ornullotherwise.- Returns:
- The container behavior, or null if attribute is singular
- Since:
- 1.6.0
-
setElementCollectionDefault
void setElementCollectionDefault()Sets the element collection behavior toEntityViewAttributeMapping.ElementCollectionBehavior.DEFAULT.- Since:
- 1.6.0
-
setElementCollectionOrdered
void setElementCollectionOrdered()Sets the element collection behavior toEntityViewAttributeMapping.ElementCollectionBehavior.ORDERED.- Since:
- 1.6.0
-
setElementCollectionSorted
Sets the element collection behavior toEntityViewAttributeMapping.ElementCollectionBehavior.SORTEDusing the given comparator class, if given, for sorting. If none is given, the element type is expected to implementComparable.- Parameters:
comparatorClass- The class of the comparator to use for sorting ornull- Since:
- 1.6.0
-
isElementCollectionForceUniqueness
boolean isElementCollectionForceUniqueness()Specifies whether elements should be forcefully deduplicated if the element collection allows duplicates or not.- Returns:
- true if uniqueness of element should be forced, false otherwise
- Since:
- 1.6.0
-
setElementCollectionForceUniqueness
void setElementCollectionForceUniqueness(boolean forceUniqueness) Sets whether elements should be forcefully deduplicated if the element collection allows duplicates or not.- Parameters:
forceUniqueness- true if uniqueness of element should be forced, false otherwise- Since:
- 1.6.0
-
getElementCollectionComparatorClass
Class<? extends Comparator<?>> getElementCollectionComparatorClass()Returns the comparator class, ornullif there none.- Returns:
- The comparator class
-
isDisallowOwnedUpdatableSubview
boolean isDisallowOwnedUpdatableSubview()Specifies whether an updatable entity view type is disallowed for owned *ToOne relationships or not.- Returns:
- true if disallowed, false otherwise
- Since:
- 1.3.0
-
setDisallowOwnedUpdatableSubview
void setDisallowOwnedUpdatableSubview(boolean disallowOwnedUpdatableSubview) Sets whether an updatable entity view type is disallowed for owned *ToOne relationships or not.- Parameters:
disallowOwnedUpdatableSubview- true if updatable entity view types should be disallowed, false otherwise- Since:
- 1.3.0
-
getComparatorClass
Class<? extends Comparator<?>> getComparatorClass()Returns the comparator class, ornullif there none.- Returns:
- The comparator class
-
getDefaultBatchSize
Integer getDefaultBatchSize()Returns the default batch size to use for batchedFetchStrategy.SELECTfetching.- Returns:
- The default batch size
-
setDefaultBatchSize
Sets the default batch size to use for batchedFetchStrategy.SELECTfetching.- Parameters:
defaultBatchSize- The default batch size
-
getCreateEmptyFlatViews
Boolean getCreateEmptyFlatViews()Returns whether to create empty flat views or not.- Returns:
- whether to create empty flat views or not
- Since:
- 1.5.0
-
setCreateEmptyFlatViews
Sets whether to create empty flat views.- Parameters:
createEmptyFlatViews- whether to create empty flat views- Since:
- 1.5.0
-
getLimitExpression
String getLimitExpression()Returns the limit expression.- Returns:
- the limit expression
- Since:
- 1.5.0
-
getOffsetExpression
String getOffsetExpression()Returns the offset expression.- Returns:
- the offset expression
- Since:
- 1.5.0
-
getOrderByItems
Returns the order by item expressions.- Returns:
- The order by item expressions
- Since:
- 1.5.0
-
setLimit
Sets the limit expression along with the order by expressions.- Parameters:
limitExpression- The limit expressionoffsetExpression- The offset expressionorderByExpressions- The order by item expressions- Since:
- 1.5.0
-
getDeclaredType
Class<?> getDeclaredType()Returns the attribute type.- Returns:
- The attribute type
-
getDeclaredKeyType
Class<?> getDeclaredKeyType()The attribute's key type, ornullif the attribute type is not a subtype ofMap.- Returns:
- The attribute's key type, or
null
-
getDeclaredElementType
Class<?> getDeclaredElementType()- Returns:
- The attribute's element type, or
null
-