task #7052
closeddiscuss eager loading of term representations
100%
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
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.
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.....
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
Updated by Andreas Kohlbecker over 6 years ago
- Copied to task #7054: clean up initialization strategy using '.representations' added