This repository was archived by the owner on Jan 19, 2022. It is now read-only.
This repository was archived by the owner on Jan 19, 2022. It is now read-only.
Error when comparing Key #2609
Open
Description
Hi,
I have issue, I am trying to do NOT EQUAL on key and I separate it in two queries as you can see in the code below. But I keep having error about the " ID property was required but does not exist for the type".
Can you please let me know why that ?
`
@repository
public interface ProductRepository extends DatastoreRepository<Product, Key> {
@query("select * from product where id > @product_key and code = @product_code")
Product existsByCodeLow(@param("product_code")String code, @param("product_key")Key key);
@Query("select * from product where id < @product_key and code = @product_code")
Product existsByCodeSup(@Param("product_code")String code, @Param("product_key")Key key);
}
`
Here is the error I got:
org.springframework.cloud.gcp.data.datastore.core.mapping.DatastoreDataException: An ID property was required but does not exist for the type: class com.google.cloud.datastore.Key