Spring Roo: use JPA object as DAO

The following is the default Spring Roo code, EntityManager is injected into your POJO domain model with the rest of the methods for managing the entity (saving, updating, deleting, findXXX, ...).

Perhaps this is a more object-oriented approach (as opposed to

+6
source share
1 answer
  • You will find more about this in the link in the third paragraph.

  • You do not get the Service level in a typical Roo application. Your service methods are contained within the entity itself, so you can use @Transactional inside your object to ensure that a particular method is included in the transaction. However, you can get a separate service level with the latest version of Spring Roo 1.2, which will allow you to do this.

  • ADM vs. DDD: A separate SO question will help. In any case, you can get a lot of understanding of this topic in the SpringSource Roo forum. http://forum.springsource.org/showthread.php?77322-Spring-Roo-with-a-services-DAO-architecture

Cheers and all the best with Roo! :)

+3
source

Source: https://habr.com/ru/post/897869/


All Articles