spring-projects / spring-projects/spring-data-couchbase

ReactiveAfterConvertCallback not called after find operations

Open
#1,854 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: task
Dominant language
Java
Stars
284
Forks
197
PR merge metrics
No merged PRs in 30d

Description

To me it seems that ReactiveAfterConvertCallback is only called after entity save operations so I guess that at the moment we cannot modify entities after find operations using entity callbacks?

The method javadoc does state that Entity callback method invoked after a domain object is converted to be persisted. although the class level javadoc says Callback being invoked after a domain object is materialized from a CouchbaseDocument when reading results. these seem contradicting to me?

Maybe we need to implement more callbacks, possibly borrowing following callbacks from spring-data-mongodb?

The following callback methods are present in AbstractMappingEventListener:
onBeforeConvert: Called in MongoTemplate insert, insertList, and save operations before the object is converted to a Document by a MongoConverter.
onBeforeSave: Called in MongoTemplate insert, insertList, and save operations before inserting or saving the Document in the database.
onAfterSave: Called in MongoTemplate insert, insertList, and save operations after inserting or saving the Document in the database.
onAfterLoad: Called in MongoTemplate find, findAndRemove, findOne, and getCollection methods after the Document has been retrieved from the database.
onAfterConvert: Called in MongoTemplate find, findAndRemove, findOne, and getCollection methods after the Document has been retrieved from the database was converted to a POJO.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing where ReactiveAfterConvertCallback is invoked during save and find operations. Compare its javadocs with the callback methods listed from spring-data-mongodb, then determine the intended read-operation behavior and document a clear completion criterion; the issue names no files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.