Hi, Agree, in past I tried to transfer JPA entities in JSON with EclipseMoxy. It work's with simple object and link between entities but you have to mix JPA and JSON in the same POJO and that is not good for maintainability. It's better to separate.
François François Papon [email protected] Le 23/07/2018 à 17:03, Christian Schneider a écrit : > In very simple cases it is possible to transfer JPA entities but it is > not a good practice to do so. > > For a remote service it makes sense to have a separate DTO. Often you > can also tailor the DTO to the use case of the remote service. Like in > the service facade pattern. > > Christian > > Am Mo., 23. Juli 2018 um 14:53 Uhr schrieb ceugster > <[email protected] <mailto:[email protected]>>: > > So if I get it right, I have theoretically two classes for Car, an > entity Car > and a DTO Car. Both have same fields and getters/setters. and as > next step I > use one class (instead of interface) car, that is used for both? > Or is it > better to separate each implementation (jpa entity and data transfer > object)? > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html > > > > -- > -- > Christian Schneider > http://www.liquid-reality.de > > Computer Scientist > http://www.adobe.com >
