citerus / dddsample-core

This is the new home of the original DDD Sample app (previously hosted at sf.net)..
MIT License
4.94k stars 1.47k forks source link

Replace Hibernate with JPA #73

Closed orende closed 1 year ago

orende commented 1 year ago

Replaces the Hibernate repository layer with a Spring Data JPA layer. Also replaces the XML-mapping files with annotations on the model classes.

hisnamewasjaan commented 1 year ago

A question if I may. Just wondering about these changes to the domain model.. Is mixing JPA/ORM into the model considered good practice? I would think not, but what is the argument? Would it perhaps be cleaner to do OR mapping inside the repository implementations?

mackapappa commented 1 year ago

A question if I may. Just wondering about these changes to the domain model.. Is mixing JPA/ORM into the model considered good practice? I would think not, but what is the argument? Would it perhaps be cleaner to do OR mapping inside the repository implementations?

Good question. Prior to this refactoring the Hibernate mapping was also closely tied to the domain objects even though the connection was not in the java-code itself but in a xml-file. So I would argue that we have not changed the design and that your question is about if this is a preferable design or not. Let's continue this discussion here