Guys,
I use the Generic DAO
pattern to model my DAO layer. I have a domain object (application level) termed as Content. A Content may be an Article, Question, Answer or any other object which is persistable in the database. All these persistable entities extent the Content which is just a marker object. Now in my persistence layer, I would like to have a method that returns a Question entity based on the id passed to it. The DAO (for the Content domain) looks like:
But here when I call the getRandomQuestion by passing the technologyId, I should get a Question object in return. I'm thinking of using the JDK dynamic proxy in this scenario. Any suggestions?