Support for foreign key/joins in Spring Data Cloud Spanner
See original GitHub issueIs your feature request related to a problem? Please describe.
The documentation for Spring Data for Cloud Spanner claims that foreign key constraints are not natively supported in cloud spanner. Yet according to this documentation, they are supported. While it seems interleaving is the ideal solution for one-to-many relationships, foreign keys are necessary for many-to-many relationships and sometimes for one-to-one. However it seems to ORM mapping annotations for spanner only supports @Interleaved
. What’s the current suggested solution for mapping @OneToOne
and @ManyToMany
relationships?
Describe the solution you’d like
Adding @OneToOne
, @OneToMany
, ManyToOne
, and @ManyToMany
mapping annotations to the com.google.cloud.spring.data.spanner.core.mapping package for cases where we want to use foreign keys rather than interleaving.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top GitHub Comments
Ah thank you guys, the Hibernate dialect + Spring Data JPA seems like a suitable alternative. Though it would be awesome if Cloud Spanner Spring Data supported some annotations for foreign keys. Hope this feature request gets some interest!
@2021H1030044G #874 is a better fit for a new contributor.