File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes how to pass search criteria with DTO or JPA entity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "how to pass search criteria with DTO or JPA entity" Watch "how to pass search criteria with DTO or JPA entity" New topic
Author

how to pass search criteria with DTO or JPA entity

raj sirohi
Ranch Hand

Joined: Mar 02, 2010
Posts: 35
Hello,
Since DTO is a retired pattern, what is the best way to pass search critieria from web tier. before I would create a DTo and set its parameters in the web tier and pass it to the business tier for setting the parameters to namedquery, does it mean that now I can create a jpa entity and set its fields and pass it to business tier. is it ok?

thanks
raj

SCJP5.0 , SCBCD5.0, SCEA
Riyaz Enayath
Ranch Hand

Joined: Sep 01, 2009
Posts: 33

I think DTO + jpa named query is right selection for search functionality implmentation to avoid exposing jpa entity directly to web layer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to pass search criteria with DTO or JPA entity
 
It's not a secret anymore!