Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.jpa.database: MYSQL
- spring.jpa.hibernate.ddl-auto: update
- spring.datasource.driver-class-name=com.mysql.jdbc.Driver
- spring.datasource.url: jdbc:mysql://localhost:3306/databasename?useUnicode=yes&characterEncoding=UTF-8
- spring.datasource.username: root
- spring.datasource.password: password
- @ManyToMany(fetch = FetchType.EAGER)
- @JoinTable(
- name = "user_userrole",
- joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id"),
- inverseJoinColumns = @JoinColumn(name = "userrole_id", referencedColumnName = "id"))
- private List<UserRole> userRoles;
- public List<UserRole> getUserRoles() {
- return userRoles;
- }
- @ManyToMany(mappedBy = "userRoles")
- private List<User> users;
- currentUser.getUserRoles();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement