[jdf-users] New comment posted on JBoss Developer Framework

Disqus notifications at disqus.net
Tue Nov 19 21:35:10 EST 2013



Vineet Reynolds <vineet.reynolds at 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: 122.166.176.114
Link to comment: http://redirect.disqus.com/url?url=http%3A%2F%2Fjboss.org%2Fjdf%2Fexamples%2Fticket-monster%2Ftutorial%2FDataPersistence%2F%23comment-1130496320%3Ab4ZqPVRe-ARGCdV9GkUWUNM1stw&impression=5fd7cc48-518c-11e3-9d8f-003048de3832&type=notification.post.moderator&event=email&behavior=click

franleplant wrote:

Hey, Im seeing this on github https://github.com/jboss-developer/ticket-monster/blob/master/demo/src/main/java/org/jboss/jdf/example/ticketmonster/model/TicketCategory.java

/*

 * 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

 */

@SuppressWarnings("serial")







Shuld I declare a Serial ID or not?
Im following the exact same stack of Ticket Monster, what do you think?


Thanks!


Fran

-----
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:
http://disqus.com/account/#notifications
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jdf-users/attachments/20131120/5bc1bf9e/attachment-0001.html 


More information about the jdf-users mailing list