Project

General

Profile

Actions

task #7052

closed

discuss eager loading of term representations

Added by Andreas Kohlbecker over 6 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
New
Category:
cdmlib
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal

Description

is almost all cases when a term is being initialized via a initialization strategy the representations are also needed.
Therefor it seems as if this is a candidate for eager loading.


Related issues

Copied to EDIT - task #7054: clean up initialization strategy using '.representations'In ProgressAndreas Müller

Actions
Actions #1

Updated by Andreas Müller over 6 years ago

  • Status changed from New to Feedback
  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Maybe I misunderstand this ticket, but as far as I can see we do already have eager loading for representations.
See the following code from TermBase:

    @XmlElementWrapper(name = "Representations")
    @XmlElement(name = "Representation")
    @OneToMany(fetch=FetchType.EAGER, orphanRemoval=true)
    @Cascade( { CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE})
    // @IndexedEmbedded no need for embedding since we are using the DefinedTermBaseClassBridge
    private Set<Representation> representations = new HashSet<>();

But I can see that RelationshipTermBase has inverse representations not being loaded eager:

    @XmlElementWrapper(name = "InverseRepresentations")
    @XmlElement(name = "Representation")
    @OneToMany(fetch = FetchType.LAZY, orphanRemoval=true)
    @JoinTable(name="TermBase_inverseRepresentation",
        joinColumns=@JoinColumn(name="term_id")
    )
    @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE})
    @IndexedEmbedded(depth = 2)
    private Set<Representation> inverseRepresentations = new HashSet<>();

Please define further what you exactly need.

Actions #2

Updated by Andreas Kohlbecker over 6 years ago

Ah ok, has this been changed during the last years? I am asking for eager loading of representations since we have a couple of init-strategies which sill include the representations:

DescriptionElementController.java
 66: "states.state.representations", 
DescriptionElementListPortalController.java (2 matches)
 45: "name.rank.representations", 
 46: "name.status.type.representations", 
FeatureTreeListPortalController.java (2 matches)
 32: "root.feature.representations", 
 33: "root.childNodes.feature.representations" 
FeatureTreePortalController.java
 56: featuretreeNodeInitStrategy.add("feature.representations"); 
NameController.java
 51: "typeStatus.representations",  
NamePortalController.java
 67: "typeStatus.representations", 
TaxonPortalController.java (7 matches)
 116: "name.rank.representations", 
 117: "name.status.type.representations", 
 133: "name.rank.representations", 
 134: "name.status.type.representations", 
 143: "synonyms.name.status.type.representations", 
 193: "name.rank.representations", 
 194: "name.status.type.representations", 
TaxonPortalListController.java (2 matches)
 32: "name.rank.representations", 
 33: "name.status.type.representations", 

All these are thus no longer needed and should be removed.
We should open a new ticket for this.....

Actions #3

Updated by Andreas Kohlbecker over 6 years ago

  • Status changed from Feedback to Rejected
  • Target version deleted (Unassigned CDM tickets)
  • % Done changed from 0 to 100
Actions #4

Updated by Andreas Kohlbecker over 6 years ago

  • Copied to task #7054: clean up initialization strategy using '.representations' added
Actions

Also available in: Atom PDF