Fixed Dataset Entity Graph to Join ExternalDatasets and not fetch them lazy loaded

This commit is contained in:
Ioannis Kalyvas 2018-10-18 16:33:37 +03:00
parent 12b37738b7
commit 5094dca494
2 changed files with 4 additions and 12 deletions

View File

@ -15,11 +15,13 @@ import java.util.stream.Collectors;
@NamedEntityGraphs({
@NamedEntityGraph(
name = "datasetListingModel",
attributeNodes = {@NamedAttributeNode("services"), @NamedAttributeNode(value = "datasetDataRepositories", subgraph = "datasetDataRepositories"), @NamedAttributeNode("datasetExternalDatasets"), @NamedAttributeNode("registries"),
attributeNodes = {@NamedAttributeNode("services"), @NamedAttributeNode(value = "datasetDataRepositories", subgraph = "datasetDataRepositories"),
@NamedAttributeNode(value = "datasetExternalDatasets", subgraph = "datasetExternalDatasets"), @NamedAttributeNode("registries"),
@NamedAttributeNode(value = "dmp", subgraph = "dmp"), @NamedAttributeNode("profile"), @NamedAttributeNode("creator")},
subgraphs = {
@NamedSubgraph(name = "dmp", attributeNodes = {@NamedAttributeNode("creator"), @NamedAttributeNode("users"), @NamedAttributeNode("project"), @NamedAttributeNode("organisations")}),
@NamedSubgraph(name = "datasetDataRepositories", attributeNodes = {@NamedAttributeNode("dataRepository")})
@NamedSubgraph(name = "datasetDataRepositories", attributeNodes = {@NamedAttributeNode("dataRepository")}),
@NamedSubgraph(name = "datasetExternalDatasets", attributeNodes = {@NamedAttributeNode("externalDataset")})
}),
@NamedEntityGraph(

View File

@ -61,7 +61,6 @@ public class WordBuilder {
run.setText(item);
run.setBold(true);
run.setFontSize(12);
//run.setUnderline(UnderlinePatterns.SINGLE);
return paragraph;
});
this.options.put(ParagraphStyle.HEADER2, (mainDocumentPart, item) -> {
@ -71,7 +70,6 @@ public class WordBuilder {
run.setText(item);
run.setBold(true);
run.setFontSize(12);
//run.setUnderline(UnderlinePatterns.SINGLE);
return paragraph;
});
this.options.put(ParagraphStyle.HEADER3, (mainDocumentPart, item) -> {
@ -81,7 +79,6 @@ public class WordBuilder {
run.setText(item);
run.setBold(true);
run.setFontSize(11);
//run.setUnderline(UnderlinePatterns.SINGLE);
return paragraph;
});
this.options.put(ParagraphStyle.FOOTER, (mainDocumentPart, item) -> {
@ -152,7 +149,6 @@ public class WordBuilder {
public XWPFParagraph addParagraphContent(String text, XWPFDocument mainDocumentPart, ParagraphStyle style, BigInteger numId) {
XWPFParagraph paragraph = this.options.get(style).apply(mainDocumentPart, text);
if (numId != null) {
paragraph.setNumID(numId);
}
@ -173,19 +169,13 @@ public class WordBuilder {
}
if (question) {
cTLvl.addNewNumFmt().setVal(STNumberFormat.DECIMAL);
//cTLvl.addNewLvlText().setVal("Q " + textLevel);
//cTLvl.addNewStart().setVal(BigInteger.valueOf(1));
cTLvl.setIlvl(BigInteger.valueOf(indent));
} else if (!question && hasIndication) {
cTLvl.addNewNumFmt().setVal(STNumberFormat.DECIMAL);
//cTLvl.addNewLvlText().setVal(textLevel);
//cTLvl.addNewStart().setVal(BigInteger.valueOf(1));
cTLvl.setIlvl(BigInteger.valueOf(indent));
}
if (!question && !hasIndication) {
cTLvl.addNewNumFmt().setVal(STNumberFormat.NONE);
//cTLvl.addNewLvlText().setVal("");
//cTLvl.addNewStart().setVal(BigInteger.valueOf(1));
cTLvl.setIlvl(BigInteger.valueOf(indent));
}
}