Class DefaultEnhancementModel
- All Implemented Interfaces:
EnhancementModel
Annotation-based persistence interpretation using Hibernate's enhancement defaults.
Recognizes entities, embeddables, and mapped superclasses by their corresponding
Jakarta Persistence annotations, excludes transient fields, and preserves the
supplied persistent-field ordering. Subclasses may override individual decisions
or EnhancementModel.getCandidates() to describe an integration's model scope.
All persistent attributes are eligible for lazy-loading support by default; this preserves the enhancer's existing behavior rather than inferring a fetch plan from annotations. Collection handling recognizes plural mapping annotations and treats otherwise unclassified collection fields as plural unless marked basic.
This implementation is stateless. Mutable discovery results, including implicit embeddable classifications, belong to the session, not this model.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanIdentifies explicitly known embeddables.booleanisEntityClass(UnloadedClass type) booleanisLazyLoadable(UnloadedField field) booleanisMappedCollection(UnloadedField field) Distinguishes persistent plural attributes from collection-valued basic attributes when the enhancer handles a collection-typed field.booleanbooleanisPersistentField(UnloadedField field) Determines persistent-field eligibility after the enhancer has excluded static fields and its generated implementation fields.order(UnloadedField[] fields) Orders persistent fields consistently with the model's attribute ordering.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EnhancementModel
getCandidates
-
Constructor Details
-
DefaultEnhancementModel
public DefaultEnhancementModel()
-
-
Method Details
-
isEntityClass
- Specified by:
isEntityClassin interfaceEnhancementModel- Parameters:
type- an unloaded class descriptor- Returns:
- whether the class is an entity within this model
-
isCompositeClass
Description copied from interface:EnhancementModelIdentifies explicitly known embeddables. Session discovery additionally recognizes types used as embedded attributes, even without an embeddable annotation.- Specified by:
isCompositeClassin interfaceEnhancementModel- Parameters:
type- an unloaded class descriptor- Returns:
- whether the model explicitly recognizes an embeddable class
-
isMappedSuperclassClass
- Specified by:
isMappedSuperclassClassin interfaceEnhancementModel- Parameters:
type- an unloaded class descriptor- Returns:
- whether the class supplies persistent state as a mapped superclass
-
isPersistentField
Description copied from interface:EnhancementModelDetermines persistent-field eligibility after the enhancer has excluded static fields and its generated implementation fields.- Specified by:
isPersistentFieldin interfaceEnhancementModel- Parameters:
field- an unloaded field descriptor- Returns:
- whether the field represents persistent state
-
order
Description copied from interface:EnhancementModelOrders persistent fields consistently with the model's attribute ordering. Implementations may reorder the supplied array in place. A replacement array must preserve its runtime component type and contain the supplied descriptors.- Specified by:
orderin interfaceEnhancementModel- Parameters:
fields- the eligible persistent fields- Returns:
- those fields in model order
-
hasLazyLoadableAttributes
- Specified by:
hasLazyLoadableAttributesin interfaceEnhancementModel- Parameters:
type- an unloaded class descriptor- Returns:
- whether the model permits lazy attributes in this class, independently of whether lazy-loading support is enabled in the enhancement options
-
isLazyLoadable
- Specified by:
isLazyLoadablein interfaceEnhancementModel- Parameters:
field- an unloaded persistent-field descriptor- Returns:
- whether the attribute may be loaded lazily under this model
-
isMappedCollection
Description copied from interface:EnhancementModelDistinguishes persistent plural attributes from collection-valued basic attributes when the enhancer handles a collection-typed field.- Specified by:
isMappedCollectionin interfaceEnhancementModel- Parameters:
field- an unloaded persistent-field descriptor- Returns:
- whether the field should receive persistent-collection handling
-