How do you track the number of times a particular entity (say a user profile much similar to stackoverflow.com) is viewed by other users? Would it make sense to update this information when an entity is viewed using a lifecycle event like PostLoad.
Where would you store the number of times the entity has been viewed, would it be in the entity table itself? (Assumption: The system doesn't require you to track the users who actually viewed a particular profile)
Note: The underlying persistence engine is based on JPA/Hibernate