Skip to content

feat(spanner): add support for @ReadOnlyProperty#4336

Open
bradperkins-gh wants to merge 3 commits intoGoogleCloudPlatform:mainfrom
bradperkins-gh:support-read-only-property-spanner
Open

feat(spanner): add support for @ReadOnlyProperty#4336
bradperkins-gh wants to merge 3 commits intoGoogleCloudPlatform:mainfrom
bradperkins-gh:support-read-only-property-spanner

Conversation

@bradperkins-gh
Copy link
Copy Markdown

This change ensures that fields annotated with @ReadOnlyProperty are excluded from mutations while remaining readable.

Sample entity with a @ReadOnlyProperty field:

@Table(name = "custom_test_table")
private static class TestEntity {
   @PrimaryKey(keyOrder = 1)
   String id;
   
   @Column(name = "custom_col")
   String something;

   @NotMapped
   String notMapped;

   @ReadOnlyProperty
   String readOnly;
 }

The field String readOnly will be populated on queries, but will not be applied to mutations. The mutation behavior is the same as fields annotationed with '@NotMapped'.

Fixes #3753
Fixes #3992

This change ensures that fields annotated with @ReadOnlyProperty
are excluded from mutations while remaining readable.

Fixes GoogleCloudPlatform#3753
Fixes GoogleCloudPlatform#3992
@bradperkins-gh bradperkins-gh requested a review from a team as a code owner February 23, 2026 17:55
@bradperkins-gh
Copy link
Copy Markdown
Author

I have signed the Google CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spanner Does Not Ignore Generated Values Spring Data Cloud Spanner missing @ReadOnlyProperty support

1 participant