Revision db727ae6
Added by Andreas Müller almost 6 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionBase.java | ||
---|---|---|
72 | 72 |
@XmlType(name = "DescriptionBase", propOrder = { |
73 | 73 |
"describedSpecimenOrObservation", |
74 | 74 |
"descriptionSources", |
75 |
"workingSets",
|
|
75 |
"descriptiveDataSets",
|
|
76 | 76 |
"descriptionElements", |
77 | 77 |
"imageGallery", |
78 | 78 |
"isDefault" |
... | ... | |
106 | 106 |
@ManyToMany(fetch = FetchType.LAZY) //FIXME what is the difference between this and IdentifiableEntity.sources |
107 | 107 |
private Set<Reference> descriptionSources = new HashSet<Reference>(); |
108 | 108 |
|
109 |
@XmlElementWrapper(name = "WorkingSets")
|
|
110 |
@XmlElement(name = "WorkingSet")
|
|
109 |
@XmlElementWrapper(name = "DescriptiveDataSets")
|
|
110 |
@XmlElement(name = "DescriptiveDataSet")
|
|
111 | 111 |
@XmlIDREF |
112 | 112 |
@XmlSchemaType(name = "IDREF") |
113 | 113 |
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "descriptions") |
114 | 114 |
@Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE}) |
115 |
private Set<WorkingSet> workingSets = new HashSet<WorkingSet>();
|
|
115 |
private Set<DescriptiveDataSet> descriptiveDataSets = new HashSet<>();
|
|
116 | 116 |
|
117 | 117 |
@XmlElementWrapper(name = "DescriptionElements") |
118 | 118 |
@XmlElements({ |
... | ... | |
296 | 296 |
} |
297 | 297 |
|
298 | 298 |
|
299 |
public Set<WorkingSet> getWorkingSets() {
|
|
300 |
return workingSets;
|
|
299 |
public Set<DescriptiveDataSet> getDescriptiveDataSets() {
|
|
300 |
return descriptiveDataSets;
|
|
301 | 301 |
} |
302 | 302 |
|
303 |
public boolean addWorkingSet(WorkingSet workingSet){
|
|
304 |
boolean result = this.workingSets.add(workingSet);
|
|
305 |
if (! workingSet.getDescriptions().contains(this)){
|
|
306 |
workingSet.addDescription(this);
|
|
303 |
public boolean addDescriptiveDataSet(DescriptiveDataSet descriptiveDataSet){
|
|
304 |
boolean result = this.descriptiveDataSets.add(descriptiveDataSet);
|
|
305 |
if (! descriptiveDataSet.getDescriptions().contains(this)){
|
|
306 |
descriptiveDataSet.addDescription(this);
|
|
307 | 307 |
} |
308 | 308 |
return result; |
309 | 309 |
} |
310 | 310 |
|
311 |
public boolean removeWorkingSet(WorkingSet workingSet){
|
|
312 |
boolean result = this.workingSets.remove(workingSet);
|
|
313 |
if (workingSet.getDescriptions().contains(this)){
|
|
314 |
workingSet.addDescription(this);
|
|
311 |
public boolean removeDescriptiveDataSet(DescriptiveDataSet descriptiveDataSet){
|
|
312 |
boolean result = this.descriptiveDataSets.remove(descriptiveDataSet);
|
|
313 |
if (descriptiveDataSet.getDescriptions().contains(this)){
|
|
314 |
descriptiveDataSet.addDescription(this);
|
|
315 | 315 |
} |
316 | 316 |
return result; |
317 | 317 |
} |
318 | 318 |
|
319 |
protected void setWorkingSets(Set<WorkingSet> workingSets) {
|
|
320 |
this.workingSets = workingSets;
|
|
319 |
protected void setDescriptiveDataSet(Set<DescriptiveDataSet> descriptiveDataSets) {
|
|
320 |
this.descriptiveDataSets = descriptiveDataSets;
|
|
321 | 321 |
} |
322 | 322 |
|
323 | 323 |
|
... | ... | |
358 | 358 |
result = (DescriptionBase<?>)super.clone(); |
359 | 359 |
|
360 | 360 |
//working set |
361 |
result.workingSets = new HashSet<WorkingSet>();
|
|
362 |
for (WorkingSet workingSet : getWorkingSets()){
|
|
363 |
workingSet.addDescription(result);
|
|
361 |
result.descriptiveDataSets = new HashSet<DescriptiveDataSet>();
|
|
362 |
for (DescriptiveDataSet descriptiveDataSet : getDescriptiveDataSets()){
|
|
363 |
descriptiveDataSet.addDescription(result);
|
|
364 | 364 |
} |
365 | 365 |
|
366 | 366 |
//descriptions |
Also available in: Unified diff
fix #7405 Rename WorkingSet to DescriptiveDataSet