Java – JPA POJO as data object

What are the best practices for using JPA entities?

Since the JPA entity is only a POJO, is it appropriate to use this object as a data object in other parts of the system or convert it to another data object?

Is it acceptable to use JPA entity POJOs in other parts of the system that are not related to JPA?

Solution

Entities can now transport their own data, so why convert them into something else? In other words, I tend to agree with dto an antipattern in EJB 3.0:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>