entity with relationships through GWT RPC problem

前端 未结 2 1445
情话喂你
情话喂你 2021-01-15 06:33

I am using JPA 2.0. (EclipseLink 2.0.2)

If an entity contains relations, for example:

@OneToMany(cascade = CascadeType.ALL, mappedBy = \"userId\")
p         


        
2条回答
  •  被撕碎了的回忆
    2021-01-15 07:11

    In general all the Persistence APIs use a technique named code injection, which means that it injects code in your POJOs classes in order to do persistence job. Because this is doing at runtime the GWT compiler was unable to see that, so it can't generates serializers for that types. The solutions is not to send Persistance Classes thru the wire. Instead use DTO (Data Transfer Objects).

    Hope this helps. Regards Daniel

提交回复
热议问题