문제

Short background: I have a software that regularly downloads files. The Statistics of these downloads are stored in the database as a DownloadResult entity, which is in turn associated to the entity representing the download job.

Now I want to make sure, that only a fixed number of the n latest downloads are preserved in the database. AFAIK in a classical (non ORM/JPA) database application, this would be done with a stored procedure.

What would be the right way to do this in a JPA driven application?

도움이 되었습니까?

해결책

You can try Quartz http://www.quartz-scheduler.org/ if you want to stay withing Java boundaries, if it is not a requirement you can go with stored procedures.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top