Class AbstractAttribute<X,Y>

java.lang.Object
com.blazebit.persistence.view.impl.metamodel.AbstractAttribute<X,Y>
All Implemented Interfaces:
Attribute<X,Y>
Direct Known Subclasses:
AbstractMethodAttribute, AbstractParameterAttribute

public abstract class AbstractAttribute<X,Y> extends Object implements Attribute<X,Y>
Since:
1.0.0
Author:
Christian Beikov
  • Field Details

    • EMPTY

      protected static final String[] EMPTY
    • declaringType

      protected final ManagedViewTypeImplementor<X> declaringType
    • javaType

      protected final Class<Y> javaType
    • convertedJavaType

      protected final Class<?> convertedJavaType
    • mapping

      protected final String mapping
    • mappingExpression

      protected final Expression mappingExpression
    • fetches

      protected final String[] fetches
    • fetchStrategy

      protected final FetchStrategy fetchStrategy
    • batchSize

      protected final int batchSize
    • orderByItems

      protected final List<OrderByItem> orderByItems
    • limitExpression

      protected final String limitExpression
    • offsetExpression

      protected final String offsetExpression
    • subqueryProviderFactory

      protected final SubqueryProviderFactory subqueryProviderFactory
    • subqueryProvider

      protected final Class<? extends SubqueryProvider> subqueryProvider
    • subqueryExpression

      protected final String subqueryExpression
    • subqueryResultExpression

      protected final Expression subqueryResultExpression
    • subqueryAlias

      protected final String subqueryAlias
    • correlationProviderFactory

      protected final CorrelationProviderFactory correlationProviderFactory
    • correlationProvider

      protected final Class<? extends CorrelationProvider> correlationProvider
    • correlationBasis

      protected final String correlationBasis
    • correlationResult

      protected final String correlationResult
    • correlated

      protected final Class<?> correlated
    • correlationKeyAlias

      protected final String correlationKeyAlias
    • correlationExpression

      protected final String correlationExpression
    • correlationBasisExpression

      protected final Expression correlationBasisExpression
    • correlationResultExpression

      protected final Expression correlationResultExpression
    • mappingType

      protected final Attribute.MappingType mappingType
    • id

      protected final boolean id
    • isAggregate

      protected final boolean isAggregate
    • updateMappableAttribute

      protected final javax.persistence.metamodel.Attribute<?,?> updateMappableAttribute
  • Constructor Details

  • Method Details

    • parseOrderByItems

      public static List<OrderByItem> parseOrderByItems(List<String> orderByItemExpressions)
    • createSimpleExpression

      protected static Expression createSimpleExpression(String expression, AttributeMapping mapping, MetamodelBuildingContext context, AbstractAttribute.ExpressionLocation expressionLocation)
    • stripThisFromMapping

      public static String stripThisFromMapping(String mapping)
    • replaceThisFromMapping

      public static String replaceThisFromMapping(String mapping, String root)
    • renderSubqueryExpression

      public final void renderSubqueryExpression(String parent, ServiceProvider serviceProvider, StringBuilder sb)
    • renderSubqueryExpression

      public final void renderSubqueryExpression(String parent, String subqueryExpression, String subqueryAlias, ServiceProvider serviceProvider, StringBuilder sb)
    • renderCorrelationBasis

      public final void renderCorrelationBasis(String parent, ServiceProvider serviceProvider, StringBuilder sb)
    • renderCorrelationResult

      public final void renderCorrelationResult(String parent, ServiceProvider serviceProvider, StringBuilder sb)
    • renderMapping

      public final void renderMapping(String parent, ServiceProvider serviceProvider, StringBuilder sb)
    • renderExpression

      protected final void renderExpression(String parent, Expression expression, String aliasToSkip, ServiceProvider serviceProvider, StringBuilder sb)
    • renderLimit

      public <T extends LimitBuilder<?> & OrderByBuilder<?>> void renderLimit(String parent, ParameterHolder<?> parameterHolder, Map<String,Object> optionalParameters, T builder)
      Specified by:
      renderLimit in interface Attribute<X,Y>
    • getCollectionJoinMappings

      public Map<String,Boolean> getCollectionJoinMappings(javax.persistence.metamodel.ManagedType<?> managedType, MetamodelBuildingContext context)
      Collects all mappings that involve the use of a collection attribute for duplicate usage checks.
      Parameters:
      managedType - The JPA type against which to evaluate the mapping
      context - The metamodel context
      Returns:
      The mappings which contain collection attribute uses
    • hasJoinFetchedCollections

      public boolean hasJoinFetchedCollections()
    • hasSelectOrSubselectFetchedAttributes

      public boolean hasSelectOrSubselectFetchedAttributes()
    • hasJpaManagedAttributes

      public boolean hasJpaManagedAttributes()
    • determineIndexMapping

      protected String determineIndexMapping(AttributeMapping mapping)
    • determineKeyMapping

      protected String determineKeyMapping(AttributeMapping mapping)
    • determineForcedUnique

      protected boolean determineForcedUnique(MetamodelBuildingContext context)
    • getUpdateMappableAttribute

      public javax.persistence.metamodel.Attribute<?,?> getUpdateMappableAttribute()
    • isFilterNulls

      protected boolean isFilterNulls()
    • isUpdateMappable

      public boolean isUpdateMappable()
    • getCorrelated

      public Class<?> getCorrelated()
    • getCorrelationKeyAlias

      public String getCorrelationKeyAlias()
    • getCorrelationExpression

      public String getCorrelationExpression()
    • getCorrelationPredicate

      public Predicate getCorrelationPredicate()
    • needsDirtyTracker

      public abstract boolean needsDirtyTracker()
    • hasDirtyStateIndex

      public abstract boolean hasDirtyStateIndex()
    • checkAttribute

      public void checkAttribute(javax.persistence.metamodel.ManagedType<?> managedType, MetamodelBuildingContext context)
    • isDisallowOwnedUpdatableSubview

      protected abstract boolean isDisallowOwnedUpdatableSubview()
    • checkNestedAttribute

      public void checkNestedAttribute(List<AbstractAttribute<?,?>> parents, javax.persistence.metamodel.ManagedType<?> managedType, MetamodelBuildingContext context, boolean hasMultisetParent)
    • isEmbedded

      protected boolean isEmbedded()
    • getTypeArguments

      protected abstract Class[] getTypeArguments()
    • getLocation

      public abstract String getLocation()
    • isUpdatable

      public abstract boolean isUpdatable()
    • isMutable

      public abstract boolean isMutable()
    • getMappedBy

      public abstract String getMappedBy()
    • isUpdateCascaded

      public abstract boolean isUpdateCascaded()
    • getUpdateCascadeAllowedSubtypes

      public abstract Set<Type<?>> getUpdateCascadeAllowedSubtypes()
    • isIndexed

      protected abstract boolean isIndexed()
    • isSorted

      protected abstract boolean isSorted()
    • isForcedUnique

      protected abstract boolean isForcedUnique()
    • isElementCollectionOrdered

      protected abstract boolean isElementCollectionOrdered()
    • isElementCollectionSorted

      protected abstract boolean isElementCollectionSorted()
    • isElementCollectionForcedUnique

      protected abstract boolean isElementCollectionForcedUnique()
    • getCollectionType

      protected abstract PluralAttribute.CollectionType getCollectionType()
    • getElementCollectionType

      protected abstract PluralAttribute.ElementCollectionType getElementCollectionType()
    • getElementType

      public abstract Type<?> getElementType()
    • elementInheritanceSubtypeMappings

      protected abstract Map<ManagedViewTypeImplementor<?>,String> elementInheritanceSubtypeMappings()
    • getKeyFetches

      protected String[] getKeyFetches()
    • getKeyMappingExpression

      public Expression getKeyMappingExpression()
    • getMappingIndexExpression

      public Expression getMappingIndexExpression()
    • getKeyType

      protected abstract Type<?> getKeyType()
    • keyInheritanceSubtypeMappings

      protected abstract Map<ManagedViewTypeImplementor<?>,String> keyInheritanceSubtypeMappings()
    • isKeySubview

      protected abstract boolean isKeySubview()
    • getAllowedSubtypes

      public abstract Set<Class<?>> getAllowedSubtypes()
    • getParentRequiringUpdateSubtypes

      public abstract Set<Class<?>> getParentRequiringUpdateSubtypes()
    • getParentRequiringCreateSubtypes

      public abstract Set<Class<?>> getParentRequiringCreateSubtypes()
    • isOptimizeCollectionActionsEnabled

      public abstract boolean isOptimizeCollectionActionsEnabled()
    • getContainerAccumulator

      public abstract ContainerAccumulator<?> getContainerAccumulator()
    • getCollectionInstantiator

      public abstract CollectionInstantiatorImplementor<?,?> getCollectionInstantiator()
    • getMapInstantiator

      public abstract MapInstantiatorImplementor<?,?> getMapInstantiator()
    • createValueContainerAccumulator

      protected final ContainerAccumulator<?> createValueContainerAccumulator(Comparator<Object> comparator)
    • createCollectionInstantiator

      protected final CollectionInstantiatorImplementor<?,?> createCollectionInstantiator(MetamodelBuildingContext context, PluralObjectFactory<? extends Collection<?>> collectionFactory, boolean indexed, boolean sorted, boolean ordered, Comparator comparator)
    • createMapInstantiator

      protected final MapInstantiatorImplementor<?,?> createMapInstantiator(MetamodelBuildingContext context, PluralObjectFactory<? extends Map<?,?>> mapFactory, boolean sorted, boolean ordered, Comparator comparator)
    • getMappingType

      public final Attribute.MappingType getMappingType()
      Specified by:
      getMappingType in interface Attribute<X,Y>
    • isQueryParameter

      public final boolean isQueryParameter()
    • isId

      public final boolean isId()
    • getSubqueryProviderFactory

      public final SubqueryProviderFactory getSubqueryProviderFactory()
    • getSubqueryProvider

      public final Class<? extends SubqueryProvider> getSubqueryProvider()
    • getSubqueryExpression

      public final String getSubqueryExpression()
    • getSubqueryAlias

      public final String getSubqueryAlias()
    • getCorrelationProviderFactory

      public CorrelationProviderFactory getCorrelationProviderFactory()
    • getCorrelationProvider

      public final Class<? extends CorrelationProvider> getCorrelationProvider()
    • getCorrelationBasis

      public final String getCorrelationBasis()
    • getCorrelationResult

      public final String getCorrelationResult()
    • getCorrelationBasisExpression

      public Expression getCorrelationBasisExpression()
    • getCorrelationResultExpression

      public Expression getCorrelationResultExpression()
    • getFetchStrategy

      public final FetchStrategy getFetchStrategy()
      Specified by:
      getFetchStrategy in interface Attribute<X,Y>
    • getBatchSize

      public final int getBatchSize()
      Specified by:
      getBatchSize in interface Attribute<X,Y>
    • getOrderByItems

      public final List<OrderByItem> getOrderByItems()
      Specified by:
      getOrderByItems in interface Attribute<X,Y>
    • getLimitExpression

      public final String getLimitExpression()
      Specified by:
      getLimitExpression in interface Attribute<X,Y>
    • getOffsetExpression

      public final String getOffsetExpression()
      Specified by:
      getOffsetExpression in interface Attribute<X,Y>
    • getMapping

      public final String getMapping()
    • getMappingExpression

      public Expression getMappingExpression()
    • isAggregate

      public boolean isAggregate()
    • isSubquery

      public final boolean isSubquery()
      Specified by:
      isSubquery in interface Attribute<X,Y>
    • getDeclaringType

      public final ManagedViewTypeImplementor<X> getDeclaringType()
      Specified by:
      getDeclaringType in interface Attribute<X,Y>
    • getJavaType

      public final Class<Y> getJavaType()
      Specified by:
      getJavaType in interface Attribute<X,Y>
    • getConvertedJavaType

      public Class<?> getConvertedJavaType()
      Specified by:
      getConvertedJavaType in interface Attribute<X,Y>
    • getFetches

      public final String[] getFetches()
      Specified by:
      getFetches in interface Attribute<X,Y>