Hi all
My name is emerson and I participate of a blog project that uses struts, tiles and hibernate ([url]sf.net/projects/personalblog[/url]). I have a question that didn't manage to answer by myself :)
Currently we have Post and Comment pojos. I'm creating a downloadable pojo that will allow downloads statistics and comments of itens that can be download (it stand for pictures, articles, and whatever).
My question : What's the best way to reuse the same comment pojo and making it related to the downloadable class.
now it is : Post --1----------*--Comment
So that each comment has a link to it's related Post
How to put the downloadable in the action and related to Comments in the same way Post is?
My first solution :
Code:
Commentable --1----------*--Comment
|
|
______|_____
| |
Post Downloadable
Since there are as lot of production instances, each one has a lot of existing comments that link to existings Posts. If using my proposed solution, should I have a Commentable unique table, or two tables for both Post and Downloadable?? Will hibernate choose the right table depending of the related sub-class??
Sorry if this question is a little dumb, if it is :), some one could sign me to a place where I can find the proper solution??
Emerson Cargnin