darrachequesne / spring-data-jpa-datatables

Spring Data JPA extension to work with the great jQuery plugin DataTables (https://datatables.net/)
Apache License 2.0
447 stars 173 forks source link

search on one to many fields #91

Closed Mike-the-one closed 5 years ago

Mike-the-one commented 5 years ago

In my orders table, it has a onetomany filed maps to a table called orderitem. Then in the orderItem table, it has a foreign key maps to product table. The product has SKU and name fields.

Something like:

Order -> [ordrid, customerName.... orderItems[]...] OrderItem- > [orderItemId, quantity... product..] Product -> [productId, sku, name ...]

So I want to be able to search by product sku and name from the UI.

How can I do that? thanks!

Mike-the-one commented 5 years ago

nvm, figured out, use additional specification, and build the predicate with the product name