0%

Use Bytecode Enhancement to Solve the Problem that @JoinColumn and @OneToOne Cannot be Truely Lazy

September 11, 2025

Kotlin

Springboot

1. Enable Bytecode Enhancement

plugins {
    id("org.hibernate.orm") version "6.4.4.Final"
}

hibernate {
    enhancement {
        enableLazyInitialization = true      // Makes @OneToOne truly lazy
        enableDirtyTracking = true          
        enableAssociationManagement = true   // Automatic bidirectional association management
    }
}