There is a use case I am struggling with SDR as below -
THere is User Table and RefSecQuestion tables
User -> ManyTOOne -> RefSecQuestion , RefSecQuestion -> OneToMany -> User
THere is User Table and UserFriends tables
User -> OneToMany UserFriends , UserFriends -> ManyToOne -> User
There is a requirement that when I go /users/{id}/userFriends ,
then firstname , lastname etc from UserProjection should be shown by default
As a result, I enabled excerptProjection in UserRepository and it works fine.
I expect about 100 results here so that is fine if this result is not paginated.
But , now since RefSecQuestion is also related to User , what happens is that when I go
/refSecQuestions -> this page hangs since it is trying to substitute user link with UserProjection. The RefSecQuestion table is skewed with one question for most of users and therefore the page breaks due to loss of pagination.
since i cant choose unidirectionality here as both url are needed i.e
/users/{id}/userFriends
/refSecQuestions/users
THe closest answer I found was to choose unidirectinality which is that I set Rest Export to false for User in RefSEcQuestion
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…