Announcement Announcement Module
Collapse
No announcement yet.
Updating a 'searchResultsCount' field using aop Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating a 'searchResultsCount' field using aop

    I want to have a field in my entity that keeps track of how many times the entity has appeared in search results.

    I have decided to use an aop based solution where after the "search" controller method has returned I pass the collection of entities to an @AfterReturning method in an @Aspect annotated class. This method will then update all the entities.

    Do you think this is ok? Will it be too hard on the database and slow things down too much? Or should I use something like spring batch? I don't know much about spring batch.

    Thank you for your time.
Working...
X