KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the best approach to take when you are pulling model objects from multiple datasources? For example I have an application has has some data stored in a mySQL database using hibernate. What If I wanted to store some other objects in EC2 or Google App Engine? I understand that DAO's abstract the implementation of working with a particular data source, but what about the entities themselves? At first I thought annotating my entities with jpa annotations was a great solution, but now it seems like i've really tied my entities down to a particular implementation. In the case of App Engine for example, some of these annotations make no sense. It seems like i need a pure POJO class to represent my entities, entirely free of persistence logic. If I wanted to model a Dog for example (yes lame choice, but whatever). Would it make sense to have an abstract Dog class, then define subclasses to work with particular persistence solutions: HibernateDog, GAEDog, etc. Thanks.
Tags (comma-separated)
Save Edits
Cancel