Good day/night to all of you.
In our university project we have a database created by hibernate (using postgresql) having 17 tables(obejct). We need to post a limit to 4 object i.e. student_comments, student_attachments, student_drafts, student_fotos
1) limit number of comments posted by the student to 1000 per student and their combine size in the database should not exceed 40 MB. 2) limit student_attachments to maximum of 120 MB per student i.e. students can post any number of attachments but their combine size should not exceed 120 MB of space. 3) same restriction as studnet_attachments object, but their combine size should be limited to 80 MB 4) the same but limit should be 50 MB per student.
in case one of this restriction is reached we would like to disable that students account.
The student_comments are stored as
@Lob public String comment;
and the attachments, fotos and drafts are stored as
private byte[] data;
Unfortunately my professor said that he might want to change the limits in the future so we need to code those limits in a way that they could be later easily changed i.e. increased.
This question is addressing the best practise’s used, i.e what would be the best solution to our problem using hibernate and postgresql?
Regards,
K
PS: I have posted this topic in the general discussion as i do not know where to begin searching. Thank you in advanced.
|