Project

General

Profile

« Previous | Next » 

Revision a784f00f

Added by Katja Luther about 14 years ago

merge cate-development2 branch with trunk

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Person.java
110 110
    @NotNull
111 111
	private TimePeriod lifespan = TimePeriod.NewInstance();
112 112
	
113
    @XmlElementWrapper(name = "InstitutionalMemberships")
113
    @XmlElementWrapper(name = "InstitutionalMemberships", nillable = true)
114 114
    @XmlElement(name = "InstitutionalMembership")
115 115
    @OneToMany(fetch=FetchType.LAZY, mappedBy = "person")
116 116
	@Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE})
117
	@NotNull
118
	protected Set<InstitutionalMembership> institutionalMemberships = new HashSet<InstitutionalMembership>();
117
	protected Set<InstitutionalMembership> institutionalMemberships;
119 118

  
120 119
	/** 
121 120
	 * Creates a new empty instance for a person whose existence is all what is known.
......
187 186
	}
188 187

  
189 188
	protected void addInstitutionalMembership(InstitutionalMembership ims){
190
		this.institutionalMemberships.add(ims);
189
		getInstitutionalMemberships().add(ims);
191 190
		if (ims.getPerson() != this){
192 191
			logger.warn("Institutional membership's person has to be changed for adding it to person: " + this);
193 192
			ims.getPerson().removeInstitutionalMembership(ims);
......
224 223
	public void removeInstitutionalMembership(InstitutionalMembership ims){
225 224
		ims.setInstitute(null);
226 225
		ims.setPerson(null);
227
		this.institutionalMemberships.remove(ims);
226
		getInstitutionalMemberships().remove(ims);
228 227
	}
229 228

  
230 229
	/**

Also available in: Unified diff