-
Notifications
You must be signed in to change notification settings - Fork 452
Description
Describe the bug
I am migrating an application using an old version of morphia to Quarkus.
I have notice a breaking change regarding the index validation on @reference property.
Before it was possible to référence them inside the index but now it is no more possible : a ValidationException is thrown instead.
To Reproduce
Steps to reproduce the behavior:
Have an entity with a property annotated with @reference
Reference the property inside @Index
Sample:
@Entity(value = "Child")
public class Child {
@Id
ObjectId id;
}
@Entity(value = "Parent")
@Indexes({
@Index(fields = @Field(value = "child.$id"), options = @IndexOptions(disableValidation = true))
})
public class Parent {
@Reference
Child child;
}The change has been made on the resolve method in PathTarget when it checks if an element is present and if the field is a reference. Line 175.
Does this behavior is expected ?
Maybe a check can be added if we want to validateNames or not ?
Expected behavior
Application should start.
Index should be created.
** Please complete the following information: **
- Server Version: quarkus-morphia 0.5.0
- Driver Version:
- Morphia Version:
Additional context
Any example models, queries, and executable test cases you can supply will greatly help debugging your issue: