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 Classes Modifier and Type Interface Description static class
EntityViewAttributeMapping.ContainerBehavior
The behavior of a plural attribute container. -
Method Summary
Modifier and Type Method Description Class<? extends Comparator<?>>
getComparatorClass()
Returns the comparator class, ornull
if there none.EntityViewAttributeMapping.ContainerBehavior
getContainerBehavior()
Returns the behavior of a plural attribute container if the attribute is plural, ornull
otherwise.Boolean
getCreateEmptyFlatViews()
Returns whether to create empty flat views or not.Class<?>
getDeclaredElementType()
Class<?>
getDeclaredKeyType()
The attribute's key type, ornull
if the attribute type is not a subtype ofMap
.Class<?>
getDeclaredType()
Returns the attribute type.EntityViewMapping
getDeclaringView()
Returns the mapping of the view declaring this attribute.Integer
getDefaultBatchSize()
Returns the default batch size to use for batchedFetchStrategy.SELECT
fetching.String
getLimitExpression()
Returns the limit expression.String
getOffsetExpression()
Returns the offset expression.List<String>
getOrderByItems()
Returns the order by item expressions.boolean
isCollection()
Returns whether this attribute is of the plural type.boolean
isDisallowOwnedUpdatableSubview()
Specifies whether an updatable entity view type is disallowed for owned *ToOne relationships or not.boolean
isForceUniqueness()
Specifies whether elements should be forcefully deduplicated if the collection allows duplicates or not.void
setContainerDefault()
Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.DEFAULT
.void
setContainerIndexed()
Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.INDEXED
.void
setContainerOrdered()
Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.ORDERED
.void
setContainerSorted(Class<? extends Comparator<?>> comparatorClass)
Sets the container behavior toEntityViewAttributeMapping.ContainerBehavior.SORTED
using the given comparator class, if given, for sorting.void
setCreateEmptyFlatViews(Boolean createEmptyFlatViews)
Sets whether to create empty flat views.void
setDefaultBatchSize(Integer defaultBatchSize)
Sets the default batch size to use for batchedFetchStrategy.SELECT
fetching.void
setDisallowOwnedUpdatableSubview(boolean disallowOwnedUpdatableSubview)
Sets whether an updatable entity view type is disallowed for owned *ToOne relationships or not.void
setForceUniqueness(boolean forceUniqueness)
Sets whether elements should be forcefully deduplicated if the collection allows duplicates or not.void
setLimit(String limitExpression, String offsetExpression, List<String> orderByExpressions)
Sets 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:
true
if this attribute is of the plural type,false
otherwise
-
getContainerBehavior
EntityViewAttributeMapping.ContainerBehavior getContainerBehavior()Returns the behavior of a plural attribute container if the attribute is plural, ornull
otherwise.- 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.SORTED
using 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
-
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, ornull
if there none.- Returns:
- The comparator class
-
getDefaultBatchSize
Integer getDefaultBatchSize()Returns the default batch size to use for batchedFetchStrategy.SELECT
fetching.- Returns:
- The default batch size
-
setDefaultBatchSize
Sets the default batch size to use for batchedFetchStrategy.SELECT
fetching.- 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, ornull
if 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
-