I thought it was a good idea to use single table inheritance for my use case - the ability to store different content types in the one table. In my case storing different article types (link, text, image).
- text (the base class)
- articleId
- text
- link (extends of text)
- super(articleId, text)
- link
- image (extends of text)
- super(articleId, text)
- image
- imageDescription
I'm in the process of making a feed of different articles (image, text, and link), and came across the problem that I cannot select * from text
and have the super classes included? Is there a way around this? Have I chosen the wrong database schema setup?
It'd be ideal if I could select all from text and have the link & image objects included.
Another problem I'm facing is whether I should use the one controller in spring for my text, link, and image
classes? At the moment I've got 3 different controllers, and 3 different services for each of the extended entities?!