Interface EnhancementOptions
public interface EnhancementOptions
Controls generated enhancement features and handling of unsupported classes.
These choices are independent of the persistent attributes described by an
EnhancementModel and the bytecode supplied by an EnhancementEnvironment.
An EnhancementSession may create enhancers with different options over the
same model. Options must remain stable for each enhancer's lifetime and support
concurrent queries when that enhancer is used concurrently. Client enhancers
use disabled managed-generation flags; client field-access rewriting is selected
by calling [Enhancer#enhanceClient(String, byte[])].
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDeprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement.default booleanDeprecated, for removal: This API element is subject to removal in a future version.UsedoBiDirectionalAssociationManagement()instead.default booleanWhether to generate inline tracking of changes to persistent attributes.default booleandoDirtyCheckingInline(UnloadedClass classDescriptor) Deprecated, for removal: This API element is subject to removal in a future version.UsedoDirtyCheckingInline()instead.default booleanDeprecated, for removal: This API element is subject to removal in a future version.Use the separateEnhancer.enhanceClient(String, byte[])operation instead.default booleandoExtendedEnhancement(UnloadedClass classDescriptor) Deprecated, for removal: This API element is subject to removal in a future version.UsedoExtendedEnhancement()instead.default booleanWhether to generate lazy-loading support.default UnsupportedEnhancementStrategySelects the policy for unsupported mappings, such as property-access attributes whose accessor names do not match their underlying fields.static EnhancementOptionsof(boolean dirtyTracking, boolean lazyInitialization, boolean associationManagement) Creates immutable settings for the three managed-generation features.
-
Method Details
-
of
static EnhancementOptions of(boolean dirtyTracking, boolean lazyInitialization, boolean associationManagement) Creates immutable settings for the three managed-generation features. Extended enhancement remains disabled and the unsupported-class policy isUnsupportedEnhancementStrategy.SKIP. Passing false for all three flags supplies the managed-generation settings for a client enhancer.- Parameters:
dirtyTracking- whether to generate inline dirty trackinglazyInitialization- whether to generate lazy-loading support for attributes permitted by the modelassociationManagement- whether to generate bidirectional association management- Returns:
- options exposing these flags through the no-argument feature methods
-
doLazyInitialization
default boolean doLazyInitialization()Whether to generate lazy-loading support. Attribute eligibility is separately determined byEnhancementModel.hasLazyLoadableAttributes(UnloadedClass)andEnhancementModel.isLazyLoadable(UnloadedField).- Returns:
- true by default
-
getUnsupportedEnhancementStrategy
Selects the policy for unsupported mappings, such as property-access attributes whose accessor names do not match their underlying fields. This policy does not convert arbitrary transformation errors into skips.- Returns:
UnsupportedEnhancementStrategy.SKIPby default
-
doDirtyCheckingInline
default boolean doDirtyCheckingInline()Whether to generate inline tracking of changes to persistent attributes. The default delegates to the deprecated class-argument method with null.- Returns:
- true to generate dirty-tracking support
-
doExtendedEnhancement
Deprecated, for removal: This API element is subject to removal in a future version.Use the separateEnhancer.enhanceClient(String, byte[])operation instead.Whether the managed pass should also rewrite client field accesses using the legacy combined enhancement path. New integrations use the separate [Enhancer#enhanceClient(String, byte[])] operation.- Returns:
- false by default
-
doBiDirectionalAssociationManagement
Deprecated, for removal: This API element is subject to removal in a future version.Will be removed without replacement. See HHH-19660Whether to generate automatic maintenance of the opposite side of a bidirectional association. The default delegates to the deprecated field-argument method with null.- Returns:
- false by default
-
doDirtyCheckingInline
Deprecated, for removal: This API element is subject to removal in a future version.UsedoDirtyCheckingInline()instead.Legacy class-argument form ofdoDirtyCheckingInline(). The no-argument default calls this method with null; enhancers do not use it to select different generation settings for individual classes.- Parameters:
classDescriptor- a class descriptor, possibly null; ignored by the default implementation- Returns:
- true by default
-
doExtendedEnhancement
@Deprecated(forRemoval=true, since="7.1") default boolean doExtendedEnhancement(UnloadedClass classDescriptor) Deprecated, for removal: This API element is subject to removal in a future version.UsedoExtendedEnhancement()instead.Legacy class-argument form ofdoExtendedEnhancement(). The no-argument default calls this method with null.- Parameters:
classDescriptor- a class descriptor, possibly null; ignored by the default implementation- Returns:
- false by default
-
doBiDirectionalAssociationManagement
@Deprecated(forRemoval=true, since="7.1") default boolean doBiDirectionalAssociationManagement(UnloadedField field) Deprecated, for removal: This API element is subject to removal in a future version.UsedoBiDirectionalAssociationManagement()instead.Legacy field-argument form ofdoBiDirectionalAssociationManagement(). The no-argument default calls this method with null; enhancers do not use it to select different generation settings for individual associations.- Parameters:
field- a field descriptor, possibly null; ignored by the default implementation- Returns:
- false by default
-