Open spring-projects-issues opened 4 years ago
Hello,
Did you find a workaround for this ? Im also stick with this:
org.springframework.data.mapping.PropertyReferenceException: No property (CASE WHEN consition THEN value END) found for type BatchCollectOperationItem!
Thanks,
We ended up doing something similar to this:
public static Specification<Example> getOrderSpecification() {
return (root, cq, cb) -> {
final Expression<Object> orderCase = cb.selectCase(root.get(Example_.PROCESSING_STATUS))
.when(ExampleStatus.PENDING.name(), 0)
.when(ExampleStatus.ERROR.name(), 1)
// ...
.otherwise(99);
final Order order = cb.asc(orderCase);
cq.orderBy(order);
return null;
};
}
2.7.5 also have this bug
Hello,
The problem is still present in version 2.7.6 Any idea on how to disable the verification or something similar ?
I dont find any workaround, the solution from @incepter dont work when we use it with PostgreSQL DISTINCT
Thanks in advance, Regards, BrandonFL
Milan Milanov opened DATAJPA-1643 and commented
I'm using the spring boot starter JPA version 2.2.1 RELEASE, which pulls the spring data JPA project with the same dependency. I'd like to use the specification + paging findAll method, but with a twist, that the sorting should be done based on a function, and not on a simple property.
Running this code I get an exception saying that
No property nlssort(entity found for type Entity!
. The same question is asked here, and in fact the accepted answer actually works. The problem is that adding a query doesn't play along with a specification. Just for test i tried:Then the query is actually generated and executed, but all results are just sorted, nothing is filtered. Also i don't know how this would work since there are aliases, but nevertheless:
Affects: 2.2.3 (Moore SR3)