Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental Feature - Freeze and detach beans (and attach) #3317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jan 30, 2024

  1. Experimental Feature - Freeze and detach beans (and attach)

    - Frozen beans as ReadOnly + Unmodifiable collections
    - Add Transaction.freezeAndDetach() returning FrozenBeans
    - Add Transaction.attach( FrozenBeans )
    
    - InterceptReadOnly now supports lazy loading
    - Query.setReadOnly(true) now uses InterceptReadOnly [when it used to ALSO require Query.setDisableLazyLoading(true)}
    - Add EntityBeanIntercept.errorOnLazyLoad (such that lazy loading on frozen bean is an error)
    
    - BeanList, BeanSet, BeanMap are now freezable
    - ModifyAwareList Set and Map are now freezable
    rbygrave committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    bc302b1 View commit details
    Browse the repository at this point in the history
  2. ToMany collections that are not loaded on freeze are marked unloaded

    They are marked as unloaded which means accessing the collection will
    throw a PersistenceException.
    
    e.g. customer.getOrders() will throw PersistenceException rather than
    return an empty list.
    rbygrave committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    93ae5f2 View commit details
    Browse the repository at this point in the history