You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DATAMONGO-1049 - Check for explicitly declared language field.
We now check for an explicitly declared language field for setting language_override within a text index. Therefore the attribute (even if named with the reserved keyword language) has to be explicitly marked with @language. Prior to this change having:
@language String lang;
String language;
would have caused trouble when trying to resolve index structures as one cannot set language override to more than one property.
Original pull request: #224.
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexResolver.java
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/BasicMongoPersistentProperty.java
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/MongoPersistentProperty.java
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,14 +61,22 @@ public interface MongoPersistentProperty extends PersistentProperty<MongoPersist
61
61
booleanisExplicitIdProperty();
62
62
63
63
/**
64
-
* Returns whether the property indicates the documents language either by having a {@link #getFieldName()} equal to
65
-
* {@literal language} or being annotated with {@link Language}.
64
+
* Returns true whether the property indicates the documents language either by having a {@link #getFieldName()} equal
65
+
* to {@literal language} or being annotated with {@link Language}.
66
66
*
67
67
* @return
68
68
* @since 1.6
69
69
*/
70
70
booleanisLanguageProperty();
71
71
72
+
/**
73
+
* Returns true when property being annotated with {@link Language}.
74
+
*
75
+
* @return
76
+
* @since 1.6.1
77
+
*/
78
+
booleanisExplicitLanguageProperty();
79
+
72
80
/**
73
81
* Returns whether the property holds the documents score calculated by text search. <br/>
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexResolverUnitTests.java
0 commit comments