Hi all,
I want to develop a blog and image gallery system. My db schema likes below;
IMAGE {table} | ARTICLE{table} | COMMENT{table}
-------------------|------------------------|-----------------------
PK id; | PK id; | PK id;
PATH String; | FULLTEXT String | ENTITY_ID {IMAGE_ID, ARTICLE_ID}
| | ENTITY_TYPE Enum{IMAGE,ARTICLE,COMMENT}
LIKES{table}
------------------------------------------------------------------|
PK id; |
ENTITY_ID {IMAGE_ID, ARTICLE_ID} |
ENTITY_TYPE Enum{IMAGE,ARTICLE,COMMENT}
|
So how can I create models? I think discriminated entities must be defined but which entities; Entity:SubClasses{IMAGE,ARTICLE} or Comment:SubClasses{ArticleComment, ImageComment}/Like:SubClasses{ImageLike,ArticleLike}?