Revision f5295f3f
Added by Andreas Kohlbecker almost 8 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ReferencedEntityBase.java | ||
---|---|---|
21 | 21 |
import javax.xml.bind.annotation.XmlSchemaType; |
22 | 22 |
import javax.xml.bind.annotation.XmlType; |
23 | 23 |
|
24 |
import org.apache.commons.lang.StringUtils; |
|
24 | 25 |
import org.apache.log4j.Logger; |
25 | 26 |
import org.hibernate.annotations.Cascade; |
26 | 27 |
import org.hibernate.annotations.CascadeType; |
... | ... | |
118 | 119 |
return result; |
119 | 120 |
} |
120 | 121 |
|
122 |
//*********************************** EQUALS *********************************************************/ |
|
123 |
|
|
124 |
/** |
|
125 |
* Indicates whether some other object is "equal to" this one. |
|
126 |
* |
|
127 |
* Uses a content based compare strategy which avoids bean initialization. This is achieved by |
|
128 |
* comparing the cdm entity ids. |
|
129 |
* |
|
130 |
* @param other |
|
131 |
* @return |
|
132 |
*/ |
|
133 |
public boolean equalsByShallowCompare(ReferencedEntityBase other) { |
|
134 |
|
|
135 |
if(this.getCitation().getId() != other.getCitation().getId() |
|
136 |
|| !StringUtils.equals(this.getCitationMicroReference(), other.getCitationMicroReference()) |
|
137 |
|| !StringUtils.equals(this.getOriginalNameString(), other.getOriginalNameString()) |
|
138 |
){ |
|
139 |
return false; |
|
140 |
} |
|
141 |
|
|
142 |
return true; |
|
143 |
} |
|
144 |
|
|
145 |
|
|
121 | 146 |
} |
Also available in: Unified diff
#4366 Transmissionengine aggregation of source references