I am using Java + Hibernate.
I have a few users and a table with companies. Users can list all companies and edit any company.
What is the best way to order companies by the last usage by the current user? So that every user sees companies he edited recently on the top of the list.
You can create the third table EditDate with columns: userId, companyId, lastEditDate. When selecting from companies of user join the EditData and order this by lastEditDate.