spring-attic / spring-cloud-gcp

Integration for Google Cloud Platform APIs with Spring
Apache License 2.0
704 stars 696 forks source link

Unknown Function Lower or LOWER #2666

Closed beunick closed 2 years ago

beunick commented 3 years ago

Hello mate,

Here is my entity

    @Entity(name="product")
    public class Product {
        @Id
    private Key id;
    private String name;
    private String code;
    @Field(name="is_deleted")
    private Boolean isDeleted;
}

My repository

@Repository
public interface ProductRepository extends DatastoreRepository<Product, Key> {

       @Query("select * from product where LOWER(code) = LOWER(@product_code) and is_deleted = @is_deleted)
    Product existsByCodeIgnoreCaseAndIsDeleted(@Param("product_code")String code, @Param("is_deleted")Boolean isDeleted);
}

When I call the method: existsByCodeIgnoreCaseAndIsDeleted() from a service I received this error message: [Request processing failed; nested exception is com.google.cloud.datastore.DatastoreException: Unknown function "LOWER".] with root cause com.google.datastore.v1.client.DatastoreException: Unknown function "LOWER".

I also tried with lowercase "lower", with no success.

Please help. Thanks

meltsufin commented 3 years ago

@beunick I don't believe Datastore supports functions like that. Where have you seen this in documentation?

elefeint commented 2 years ago

Reopen if this is still a question.