java.lang.Object
com.google.cloud.spring.data.datastore.core.util.KeyUtil

public final class KeyUtil extends Object
Utility class containing methods for transforming and manipulating Datastore keys.
Since:
1.2
  • Method Details

    • getKeyWithoutAncestors

      public static com.google.cloud.datastore.Key getKeyWithoutAncestors(com.google.cloud.datastore.Key entityKey)
      Returns a copy of the provided entityKey with its ancestors removed.

      This is useful for performing HAS_ANCESTOR queries in Datastore which do not expect a fully qualified ancestors key list in the provided key.

      Parameters:
      entityKey - The Datastore entity key to transform.
      Returns:
      A copy of the entityKey with ancestors removed.