-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ManyToMany Relation when searching #87
Comments
Not by default, since we try to prevent You should be able to add a userRepository.findAll(input, (root, query, criteriaBuilder) -> {
return criteriaBuilder.equal(root.join("role", JoinType.INNER).get("name"), roleName);
}); |
what is roleName? from where you get the roleName? |
Could you give a complete example here? |
So I had this problem, where I have a datatable of users that have a many-to-many relation with roles and I want for the global search to find user my role.name
The main problem is that you have to download darrachequesne repository classes, include them in your project as a public interface DataTablesRepositoryCustom and change the DataTablesRepositoryImpl so that the part that is defining the AND's becomes OR's
|
Does this library support ManyToMany relation when searching ?
For example, there are two table,
user
androle
. Each user may has different roles, and each role may be used by different user. Therefore there is one more relation tableuser_role
. In the user datatable, I want to show the roles attached to the user. I can add aList<Role> roles
property with annoation@ManyToMany
inUser
class and of cause I can show the roles in the datatable. But the searching function is not working with this field.The text was updated successfully, but these errors were encountered: