0

Scenario, I am working on user and scheme application.Web page is there to create and update user. similarly scheme page is available to create and update. Now using hibernate I have many to many relationship with user to scheme table. I have created USER SCHEME and USER_SCHEME tables and saving them.

scheme has huge number of users. Now I have condition if a user updates his details, if he has more than 10 certification then in schema web page he has to be highlighted with star award. SO now i m in scheme page I have only schem id. I need to identify only the updated user with more than 10 certification.

shreekanth
  • 459
  • 2
  • 12
  • 27
  • I think what you are looking for is [aggregate functions to determine the number of references][1] and [joins to fetch referenced objects][2]. [1]: http://stackoverflow.com/questions/2911558/jpa-and-aggregate-functions-how-do-i-use-the-result-of-the-query [2]: http://stackoverflow.com/questions/15359306/how-to-load-lazy-fetched-items-from-hibernate-jpa-in-my-controller – Talorias Sep 03 '15 at 12:35
  • IF user updates something its stored in user table, user id remains same across other table. How to identify, only this particular record been updated user_scheme table when I am querrying. @Talorias – shreekanth Sep 03 '15 at 12:48

1 Answers1

0

After updating the table you can perform a count() on references to the user. Depending on the result you can update the other view. You can also count the references when you are loading the schemes page...

Talorias
  • 29
  • 3