Skip to content
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

Description

@beunick

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

awaitingwaiting for something externaldatastoreGCP Datastore

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions