The entity path.
An entity path consists of one or more elements composed of a kind and a
string or numerical identifier, which identify entities. The first
element identifies a root entity, the second element identifies
a child of the root entity, the third element identifies a child of the
second entity, and so forth. The entities identified by all prefixes of
the path are called the element's ancestors.
An entity path is always fully complete: all of the entity's ancestors
are required to be in the path along with the entity identifier itself.
The only exception is that in some documented cases, the identifier in the
last path element (for the entity) itself may be omitted. For example,
the last path element of the key of Mutation.insert may have no
identifier.
A path can never be empty, and a path can have at most 100 elements.
The entity path.
An entity path consists of one or more elements composed of a kind and a
string or numerical identifier, which identify entities. The first
element identifies a root entity, the second element identifies
a child of the root entity, the third element identifies a child of the
second entity, and so forth. The entities identified by all prefixes of
the path are called the element's ancestors.
An entity path is always fully complete: all of the entity's ancestors
are required to be in the path along with the entity identifier itself.
The only exception is that in some documented cases, the identifier in the
last path element (for the entity) itself may be omitted. For example,
the last path element of the key of Mutation.insert may have no
identifier.
A path can never be empty, and a path can have at most 100 elements.
The entity path.
An entity path consists of one or more elements composed of a kind and a
string or numerical identifier, which identify entities. The first
element identifies a root entity, the second element identifies
a child of the root entity, the third element identifies a child of the
second entity, and so forth. The entities identified by all prefixes of
the path are called the element's ancestors.
An entity path is always fully complete: all of the entity's ancestors
are required to be in the path along with the entity identifier itself.
The only exception is that in some documented cases, the identifier in the
last path element (for the entity) itself may be omitted. For example,
the last path element of the key of Mutation.insert may have no
identifier.
A path can never be empty, and a path can have at most 100 elements.
The entity path.
An entity path consists of one or more elements composed of a kind and a
string or numerical identifier, which identify entities. The first
element identifies a root entity, the second element identifies
a child of the root entity, the third element identifies a child of the
second entity, and so forth. The entities identified by all prefixes of
the path are called the element's ancestors.
An entity path is always fully complete: all of the entity's ancestors
are required to be in the path along with the entity identifier itself.
The only exception is that in some documented cases, the identifier in the
last path element (for the entity) itself may be omitted. For example,
the last path element of the key of Mutation.insert may have no
identifier.
A path can never be empty, and a path can have at most 100 elements.
The entity path.
An entity path consists of one or more elements composed of a kind and a
string or numerical identifier, which identify entities. The first
element identifies a root entity, the second element identifies
a child of the root entity, the third element identifies a child of the
second entity, and so forth. The entities identified by all prefixes of
the path are called the element's ancestors.
An entity path is always fully complete: all of the entity's ancestors
are required to be in the path along with the entity identifier itself.
The only exception is that in some documented cases, the identifier in the
last path element (for the entity) itself may be omitted. For example,
the last path element of the key of Mutation.insert may have no
identifier.
A path can never be empty, and a path can have at most 100 elements.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface KeyOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.datastore.v1.KeyOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.datastore.v1.KeyOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.datastore.v1.KeyOrBuilder) \n\n public interface KeyOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getPartitionId()\n\n public abstract PartitionId getPartitionId()\n\nEntities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.\n\n`.google.events.cloud.datastore.v1.PartitionId partition_id = 1;`\n\n### getPartitionIdOrBuilder()\n\n public abstract PartitionIdOrBuilder getPartitionIdOrBuilder()\n\nEntities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.\n\n`.google.events.cloud.datastore.v1.PartitionId partition_id = 1;`\n\n### getPath(int index)\n\n public abstract Key.PathElement getPath(int index)\n\nThe entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a *root entity* , the second element identifies\na *child* of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's *ancestors* .\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\nA path can never be empty, and a path can have at most 100 elements.\n\n`repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;`\n\n### getPathCount()\n\n public abstract int getPathCount()\n\nThe entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a *root entity* , the second element identifies\na *child* of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's *ancestors* .\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\nA path can never be empty, and a path can have at most 100 elements.\n\n`repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;`\n\n### getPathList()\n\n public abstract List\u003cKey.PathElement\u003e getPathList()\n\nThe entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a *root entity* , the second element identifies\na *child* of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's *ancestors* .\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\nA path can never be empty, and a path can have at most 100 elements.\n\n`repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;`\n\n### getPathOrBuilder(int index)\n\n public abstract Key.PathElementOrBuilder getPathOrBuilder(int index)\n\nThe entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a *root entity* , the second element identifies\na *child* of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's *ancestors* .\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\nA path can never be empty, and a path can have at most 100 elements.\n\n`repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;`\n\n### getPathOrBuilderList()\n\n public abstract List\u003c? extends Key.PathElementOrBuilder\u003e getPathOrBuilderList()\n\nThe entity path.\nAn entity path consists of one or more elements composed of a kind and a\nstring or numerical identifier, which identify entities. The first\nelement identifies a *root entity* , the second element identifies\na *child* of the root entity, the third element identifies a child of the\nsecond entity, and so forth. The entities identified by all prefixes of\nthe path are called the element's *ancestors* .\nAn entity path is always fully complete: *all* of the entity's ancestors\nare required to be in the path along with the entity identifier itself.\nThe only exception is that in some documented cases, the identifier in the\nlast path element (for the entity) itself may be omitted. For example,\nthe last path element of the key of `Mutation.insert` may have no\nidentifier.\nA path can never be empty, and a path can have at most 100 elements.\n\n`repeated .google.events.cloud.datastore.v1.Key.PathElement path = 2;`\n\n### hasPartitionId()\n\n public abstract boolean hasPartitionId()\n\nEntities are partitioned into subsets, currently identified by a project\nID and namespace ID.\nQueries are scoped to a single partition.\n\n`.google.events.cloud.datastore.v1.PartitionId partition_id = 1;`"]]