Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • GGCE Server GGCE Server
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GGCEGGCE
  • GGCE ServerGGCE Server
  • Issues
  • #208
Closed
Open
Issue created Jun 22, 2021 by Matija Obreza@mobrezaOwner

EmptyModel with initializeEntity

In https://gitlab.croptrust.org/grin-global/grin-global-server/-/merge_requests/252#note_55780 we discussed the Hibernate.initialize() in lazyLoad(). With this method, we don't even need checking on null.

we add that initializeEntity(Object proxy) to our super model (AuditedModel or EmptyModel) and make it protected? Then just call initializeEntity(this.counterCooperator);

In this ticket do the following:

class EmptyModel {
 protected final void initializeEntity(Object proxy) {
  Hibernate.initialize(proxy);
 }
}

class InventoryViabilityData {
 lazyLoad() {
  initializeEntity(this.inventoryViability);
  ...
 }
}

If that works, all lazyLoads can be updated with initializeEntity() instead of .getId().

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking