Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- @Query(value = "select u from User u where u.region in :#{principal.region}")
- Page<User> findAll(Pageable var1);
- @ManyToMany( mappedBy = "users")
- private List<Region> region = new ArrayList<>();
- @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
- @JoinTable(name = "region_users", joinColumns = @JoinColumn(name = "region_id", referencedColumnName= "id"),
- inverseJoinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id")
- )
- private List<User> users = new ArrayList<>();
- private List<Region> region;
- public UserPrincipal(Long id, String username, String password,
- Collection<? extends GrantedAuthority> authorities, Role role, List<Region> region) {
- this.id = id;
- this.username = username;
- this.password = password;
- this.authorities = authorities;
- this.role = role;
- this.region = region;
- }
- public List<Region> getRegion() { return this.region; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement