I realize that persistence frameworks such as Morphia and Hibernate rely on annotations on domain objects to do their magic. At some level, it seems to me that this is insertin
Are persistence annotations in domain objects a bad practice?
Yes. With the rise of NoSQL, you can not rely on single persistence strategy.
For example, today I am persisting my domain objects (let's say using morphia) into MongoDB. What if tomorrow I want to persist domain objects to Neo4j ?
Or, one might want to persist domain objects to all three kinds of databases like relational (Postgres / MySQL), MongoDB(document store) and Neo4J(graph database) just for evaluating.
In all these cases, better to have separate persistence strategy rather than just relying on domain objects
Best Practice : Passing Persistent strategy as a strategy pattern might help. But have to be careful while designing your classes / objects.