File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1515 */
1616package org .springframework .data .mongodb .core .mapping ;
1717
18+ import java .util .Objects ;
19+
1820/**
1921 * @author Christoph Strobl
22+ * @author Rogério Meneguelli Gatto
2023 * @since 3.2
2124 */
2225class UnwrapEntityContext {
@@ -30,4 +33,34 @@ public UnwrapEntityContext(MongoPersistentProperty property) {
3033 public MongoPersistentProperty getProperty () {
3134 return property ;
3235 }
36+
37+ /*
38+ * (non-Javadoc)
39+ *
40+ * @see java.lang.Object#hashCode()
41+ */
42+ @ Override
43+ public int hashCode () {
44+ return Objects .hash (property );
45+ }
46+
47+ /*
48+ * (non-Javadoc)
49+ *
50+ * @see java.lang.Object#equals(java.lang.Object)
51+ */
52+ @ Override
53+ public boolean equals (Object obj ) {
54+ if (this == obj ) {
55+ return true ;
56+ }
57+
58+ if (obj == null || getClass () != obj .getClass ()) {
59+ return false ;
60+ }
61+
62+ UnwrapEntityContext other = (UnwrapEntityContext ) obj ;
63+
64+ return Objects .equals (property , other .property );
65+ }
3366}
Original file line number Diff line number Diff line change 1818import java .lang .annotation .Annotation ;
1919import java .lang .reflect .Field ;
2020import java .lang .reflect .Method ;
21+ import java .util .Objects ;
2122
2223import org .springframework .data .mapping .Association ;
2324import org .springframework .data .mapping .PersistentEntity ;
2930 * Unwrapped variant of {@link MongoPersistentProperty}.
3031 *
3132 * @author Christoph Strobl
33+ * @author Rogério Meneguelli Gatto
3234 * @since 3.2
3335 * @see Unwrapped
3436 */
@@ -304,4 +306,34 @@ public Class<?> getAssociationTargetType() {
304306 public <T > PersistentPropertyAccessor <T > getAccessorForOwner (T owner ) {
305307 return delegate .getAccessorForOwner (owner );
306308 }
309+
310+ /*
311+ * (non-Javadoc)
312+ *
313+ * @see java.lang.Object#hashCode()
314+ */
315+ @ Override
316+ public int hashCode () {
317+ return Objects .hash (delegate , context );
318+ }
319+
320+ /*
321+ * (non-Javadoc)
322+ *
323+ * @see java.lang.Object#equals(java.lang.Object)
324+ */
325+ @ Override
326+ public boolean equals (Object obj ) {
327+ if (this == obj ) {
328+ return true ;
329+ }
330+
331+ if (obj == null || getClass () != obj .getClass ()) {
332+ return false ;
333+ }
334+
335+ UnwrappedMongoPersistentProperty other = (UnwrappedMongoPersistentProperty ) obj ;
336+
337+ return Objects .equals (delegate , other .delegate ) && Objects .equals (context , other .context );
338+ }
307339}
You can’t perform that action at this time.
0 commit comments