I am using hibernate.
I have table like this :
Table backup (ID, TIMESTAMP, DATA)
This table should have 20 rows max at any time. So when inserting row in this table. I should always check no of rows in the table. if its less than 20 then data can be inserted.
However if table size is already 20 then oldest row should be deleted and then the new row should be inserted.
And as this is a web application so there can be multiple threads.
Please suggest is there any build-in feature in hibernate or JPA to support this. If not then how can this be accomplished?
Thanks in advance.