Vineet Reynolds <vineet.reynolds(a)gmail.com> wrote, in response to franleplant:
If you want a general answer, I would recommend using Serializable for JPA entities that
also assume the role of DTOs. So you could safely transport them across layers, especially
from the business to the view layer. Note that in the current architecture, there
isn't a need to use Serializable, primarily because we use Jackson (used in RESTEasy)
to serialize JPA entities to JSON; the Jackson data binding model ignores Serializable.
As to why you notice Serializable being used in Show, that's down to the history of
the class in this application.
The same answer goes for serialVersionUID. If your entities are not serialized using the
Java native serialization mechanism, you could suppress the warning. You'd need this
when you use remote EJBs etc. and transport JPA entities over the wire (where native
serialization is likely to be used).
IP address: 126.96.36.199
Link to comment:
Hey, Im seeing this on github
* We suppress the warning about not specifying a serialVersionUID, as we are still
developing this app, and want the JVM to
* generate the serialVersionUID for us. When we put this app into production, we'll
generate and embed the serialVersionUID
Shuld I declare a Serial ID or not?
Im following the exact same stack of Ticket Monster, what do you think?
Options: You can moderate through email. Respond in the body with "Delete".
Reply with "Like" to like this comment, or respond with anything else to approve
this comment and post your message as a reply comment.
Or use the moderate panel: http://jdf.disqus.com/admin/moderate/#/pending
Stop receiving notifications when new comments are posted: