As far as I can tell this is safe enough for dirty tracking:
* The collection tracker will return a size of -1 for that collection
* Which is exactly the behavior we currently get after
$$_hibernane_clearDirtyCollectionNames is called if a collection has
been "retrieved" (getter called) but was not initialized.
* This will mainly prevent some optimizations because we will no longer
be able to tell whether a collection is "dirty" or not.
I think we should be able to restore those optimizations: for
PersistentCollection instances, we would store the "initial" size
inside the collection itself upon initialization,
and we would compare THAT size to the current size in implementations
of $$_hibernate_areCollectionFieldsDirty (see
org.hibernate.bytecode.enhance.internal.bytebuddy.CodeTemplates).
Alternatively we could store the CollectionTracker inside the
PersistentCollection so that the collection can update the tracker
upon initialization.
However, that's outside the scope of this bug, that would require
significant testing, and that may cause conflicts with ORM 6, so I won't
do it here.
- re-enable the basic-type tests in the `documentation` module
- fix basic-type resolution in various cases from tests in both `hibernate-core` and `documentation`
- updated the basic_types.adoc user-guide section + moved much of the "legacy" discussion to an appendix
- fixed missing impls of the optional contract `org.hibernate.type.AdjustableBasicType`
- improved handling of `NationalizationSupport` offered by a Dialect
NOTE :
- changes to `ColumnTransformerTest` are related to "composite basics" not being supported, not problems with `ColumnTransformer`.
- final failure in `org.hibernate.userguide.mapping.basic` is `SubselectTest#testRefreshLifecycle` which actually fails because refresh is not working properly