Revision f15eb5ec
Added by Andreas Müller about 5 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java | ||
---|---|---|
135 | 135 |
@OrderColumn(name="sortIndex") |
136 | 136 |
@ListIndexBase(value=0) //not really needed as this is the default |
137 | 137 |
@Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE}) |
138 |
private List<Media> media = new ArrayList<Media>();
|
|
138 |
private List<Media> media = new ArrayList<>(); |
|
139 | 139 |
|
140 | 140 |
@XmlElement(name = "InDescription") |
141 | 141 |
@XmlIDREF |
... | ... | |
155 | 155 |
@Merge(MergeMode.ADD_CLONE) |
156 | 156 |
private Set<DescriptionElementSource> sources = new HashSet<>(); |
157 | 157 |
|
158 |
//#8004 optional sortIndex |
|
159 |
private Integer sortIndex = null; |
|
160 |
|
|
158 | 161 |
|
159 | 162 |
|
160 | 163 |
// ************* CONSTRUCTORS *************/ |
... | ... | |
465 | 468 |
this.sources.remove(source); |
466 | 469 |
} |
467 | 470 |
|
471 |
|
|
472 |
public Integer getSortIndex() { |
|
473 |
return sortIndex; |
|
474 |
} |
|
475 |
public void setSortIndex(Integer sortIndex) { |
|
476 |
this.sortIndex = sortIndex; |
|
477 |
} |
|
478 |
|
|
468 | 479 |
// ******************* METHODS *************************************************************/ |
469 | 480 |
|
470 | 481 |
protected Map<TermVocabulary, List<DefinedTerm>> makeModifierMap(){ |
471 |
Map<TermVocabulary, List<DefinedTerm>> result = new HashMap<TermVocabulary, List<DefinedTerm>>();
|
|
482 |
Map<TermVocabulary, List<DefinedTerm>> result = new HashMap<>(); |
|
472 | 483 |
for (DefinedTerm modifier : getModifiers()){ |
473 | 484 |
TermVocabulary<DefinedTerm> voc = modifier.getVocabulary(); |
474 | 485 |
if (result.get(voc) == null){ |
475 |
result.put(voc, new ArrayList<DefinedTerm>());
|
|
486 |
result.put(voc, new ArrayList<>()); |
|
476 | 487 |
} |
477 | 488 |
result.get(voc).add(modifier); |
478 | 489 |
} |
... | ... | |
482 | 493 |
public List<DefinedTerm> getModifiers(TermVocabulary voc){ |
483 | 494 |
List<DefinedTerm> result = makeModifierMap().get(voc); |
484 | 495 |
if (result == null){ |
485 |
result = new ArrayList<DefinedTerm>();
|
|
496 |
result = new ArrayList<>(); |
|
486 | 497 |
} |
487 | 498 |
return result; |
488 | 499 |
} |
Also available in: Unified diff
fix 8004 add sortindex to DescriptionElementBase