Domain JPA search with criteria, generic/reflection based Specifications?
152 views
Skip to first unread message
manos
unread,
Mar 23, 2013, 4:54:56 AM3/23/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to resthub-dev
I'm trying to figure out a nice way to implement a generic criteria
based search for any domain entity. In other words, I would like a
base implementation to handle arbitrary search terms in URLs like
without knowing the HTTP params or the domain classes those correspond
to beforehand. Does something like the following make sense?
1) Enchance resthub'ss RestController (or my base controller?)
findPaginated signature to add a request parameter (used to obtain the
request parameter map)
2) use the parameter map with generics/reflection to build the JPA
query e.g. in the form of a
org.springframework.data.jpa.domain.Specifications
3) Add a new method to resthub's CrudService to use such a
Specifications parameter