Skip to content

Commit

Permalink
Document restriction on embedded objects (GoogleCloudPlatform#784)
Browse files Browse the repository at this point in the history
* restriction on embedded objects

* Enhanced restriction on embedded properties

* Update docs/src/main/asciidoc/spanner.adoc

Co-authored-by: Elena Felder <41136058+elefeint@users.noreply.github.com>

Co-authored-by: Elena Felder <41136058+elefeint@users.noreply.github.com>
  • Loading branch information
2 people authored and GitHub committed Dec 10, 2021
1 parent 042b3b3 commit aadaeca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/src/main/asciidoc/spanner.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ CREATE TABLE items (
) PRIMARY KEY (grandParentId, parentId, id)
----

Note that embedded properties' column names must all be unique.
Note that the following restrictions apply when you use embedded objects:

- Embedded properties' column names must all be unique.
- Embedded properties must not be passed through a constructor and the property must be mutable; otherwise you'll get an error, such as `SpannerDataException: Column not found`.
Be careful about this restriction when you use Kotlin's data class to hold an embedded property.

==== Relationships

Expand Down

0 comments on commit aadaeca

Please sign in to comment.