Spring RESTful controller method improvement suggestions

前端 未结 1 1934
误落风尘
误落风尘 2021-01-27 09:16

I am new to Spring, REST, and Hibernate. That said, I\'ve tried to put together an Enterprise-class controller method, which I plan to use as a pattern for future development.

相关标签:
1条回答
  • 2021-01-27 10:01

    Suggested Improvements:

    • a) use JPA instead of plain Hibernate
    • b) Let Spring inject the Hibernate Session/JPA Entity Manager
    • c) Let Spring do the database Handling (Annotation (@Transactional) or programmatic (TransactionTemplate) )
    0 讨论(0)
提交回复
热议问题