arangodb / spring-data

Spring Data ArangoDB
https://www.arangodb.com/docs/stable/drivers/spring-data-getting-started.html
Apache License 2.0
110 stars 56 forks source link

CRUD Repository save and saveAll should return fetched entity instead of original #291

Closed aburmeis closed 7 months ago

aburmeis commented 10 months ago

If you want to use any relations included by annotated members, currently an additional fetch is needed as the original saved entity typically has no proxies for relations or refs.

This is also a very typical behaviour of other spring data implementations. Not sure if this is a bug or an enhancement.

The code involved are the default implementations in SimpleArangoRepository which currently does an explicit return of the original entity instead of returning the REPSERT result in save() and saveAll().

rashtao commented 8 months ago

Is there any convention about it in Spring Data NoSQL projects? AFAICS in Spring Data MongoDB, CrudRepository#save(S): S returns: