Class QueryValidator


  • @Component
    public class QueryValidator
    extends java.lang.Object
    Validates queries based on the entity type that will be queried. Converts query values to the correct class type if possible.
    See Also:
    https://github.com/molgenis/molgenis/issues/5248
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryValidator​(FetchValidator fetchValidator, org.molgenis.data.EntityManager entityManager)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void validate​(org.molgenis.data.Query<? extends org.molgenis.data.Entity> query, org.molgenis.data.meta.model.EntityType entityType)
      Validates query based on the given entity type, converts query values to the expected type if necessary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QueryValidator

        public QueryValidator​(FetchValidator fetchValidator,
                              org.molgenis.data.EntityManager entityManager)
    • Method Detail

      • validate

        public void validate​(org.molgenis.data.Query<? extends org.molgenis.data.Entity> query,
                             org.molgenis.data.meta.model.EntityType entityType)
        Validates query based on the given entity type, converts query values to the expected type if necessary.
        Parameters:
        query - query
        entityType - entity type
        Throws:
        MolgenisValidationException - if query is invalid