Open rabejens opened 9 years ago
@rabejens
Criteria query support is not completely enabled in Kundera as of now and is there on our roadmap.So for now you can write basic JPQLs to get your queries working . An example of same can be found at :
Hope this Helps ! Chhavi
Can you also share the current manner in which you are issuing the query ?
Chhavi
Further to add on this currently most of the queries supported by JPQL in Kundera are supported via Criteria as well, so can you please share your specific query to look into the issue further.
Chhavi
Lets say I have a simple entity:
and a simple repository:
creating the schema at start causes the application to bail out:
This is because the query parser is instructed to build a query from the String
MyEntity.findByNameContainingIgnoringCase
. In this case, the aforementioned exception is thrown. However, this is done in theCreateIfNotFoundQueryLookupStrategy
(nested class oforg.springframework.data.jpa.repository.query.JpaQueryLookupStrategy
). There you can see that the Spring guys were prepared and create the query if it cannot be resolved. For this to work, the resolver, however, must throw a subclass ofIllegalArgumentException
but theJPQLParseException
is not a subclass thereof.When copy-pasting the
QueryHandlerException
whichJPQLParseException
subclasses and making it subclassIllegalStateException
the creation is carried-out.Now, it comes to the
JpaQueryCreator
where it tries to create a distinct query if the part tree is distinct. It then doesThis is carried-out by
KunderaCriteriaQuery
which is incomplete, there are lots of empty stub methods.So for this to work, these methods have to be implemented.