1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.model.view;
|
11
|
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
|
15
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
16
|
import eu.etaxonomy.cdm.model.common.ICdmBase;
|
17
|
import eu.etaxonomy.cdm.model.common.IReferencedEntity;
|
18
|
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
19
|
|
20
|
import java.util.*;
|
21
|
|
22
|
import javax.persistence.*;
|
23
|
|
24
|
/**
|
25
|
* use ARCHIVE view/dataset to maintain an archive. All members of that view will
|
26
|
* never be changed
|
27
|
* @author m.doering
|
28
|
* @version 1.0
|
29
|
* @created 08-Nov-2007 13:07:01
|
30
|
*/
|
31
|
@Entity(name="CDM_VIEW")
|
32
|
public class View extends CdmBase implements IReferencedEntity{
|
33
|
static Logger logger = Logger.getLogger(View.class);
|
34
|
private String name;
|
35
|
private String description;
|
36
|
private ReferenceBase reference;
|
37
|
private Set<View> superViews = new HashSet();
|
38
|
private Set<CdmBase> members = new HashSet();
|
39
|
private Set<CdmBase> nonMembers = new HashSet();
|
40
|
|
41
|
public String getName(){
|
42
|
return this.name;
|
43
|
}
|
44
|
public void setName(String name){
|
45
|
this.name = name;
|
46
|
}
|
47
|
|
48
|
public String getDescription(){
|
49
|
return this.description;
|
50
|
}
|
51
|
public void setDescription(String description){
|
52
|
this.description = description;
|
53
|
}
|
54
|
|
55
|
@Transient
|
56
|
public ReferenceBase getCitation() {
|
57
|
return getReference();
|
58
|
}
|
59
|
|
60
|
public ReferenceBase getReference() {
|
61
|
return reference;
|
62
|
}
|
63
|
|
64
|
public void setReference(ReferenceBase reference) {
|
65
|
this.reference = reference;
|
66
|
}
|
67
|
|
68
|
|
69
|
@OneToMany
|
70
|
public Set<View> getSuperViews() {
|
71
|
return superViews;
|
72
|
}
|
73
|
protected void setSuperViews(Set<View> superViews) {
|
74
|
this.superViews = superViews;
|
75
|
}
|
76
|
public void addSuperView(View superView) {
|
77
|
this.superViews.add(superView);
|
78
|
}
|
79
|
public void removeSuperView(View superView) {
|
80
|
this.superViews.remove(superView);
|
81
|
}
|
82
|
|
83
|
|
84
|
@Transient
|
85
|
public Set<CdmBase> getMembers() {
|
86
|
return members;
|
87
|
}
|
88
|
protected void setMembers(Set<CdmBase> members) {
|
89
|
this.members = members;
|
90
|
}
|
91
|
public void addMember(CdmBase member) {
|
92
|
this.members.add(member);
|
93
|
}
|
94
|
public void removeMember(ICdmBase member) {
|
95
|
this.members.remove(member);
|
96
|
}
|
97
|
|
98
|
|
99
|
@Transient
|
100
|
public Set<CdmBase> getNonMembers() {
|
101
|
return nonMembers;
|
102
|
}
|
103
|
protected void setNonMembers(Set<CdmBase> nonMembers) {
|
104
|
this.nonMembers = nonMembers;
|
105
|
}
|
106
|
public void addNonMember(CdmBase member) {
|
107
|
this.nonMembers.add(member);
|
108
|
}
|
109
|
public void removeNonMember(ICdmBase member) {
|
110
|
this.nonMembers.remove(member);
|
111
|
}
|
112
|
|
113
|
}
|