Uploaded image for project: 'MongoDB for IntelliJ Plugin'
  1. MongoDB for IntelliJ Plugin
  2. INTELLIJ-64

Improve type matching for Spring Criteria queries

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 2
    • Not Needed
    • Developer Tools

      Our current type matcher does not work anymore in a Spring Criteria project because criteria expressions from Spring boxes any primitive type in a Java object type and which then is not assignable to a detected primitive type from the parsed schema.

      Example:

      Consider the following schema

      { age: BsonInt32 }

      and the following spring query

      where(age).is(30)

      in normal world this should work but because is call converts the provided Int primitive to a Java Object type the resulting BsonType is a BsonAnyOf(BsonInt32, BsonNull) and this is not assignable to the age field which is only expecting BsonInt32

            Assignee:
            himanshu.singh@mongodb.com Himanshu Singh
            Reporter:
            himanshu.singh@mongodb.com Himanshu Singh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: