Software Development, Programming, Self Improvement, Java, Spring Boot.
LoadRoles(ContextRefreshedEvent event) { List<ERole> roles = Arrays.stream(ERole.values()).toList(); for(ERole erole: roles) { if (roleRepository.findByName(erole)==null) { roleRepository.save(new Role(erole)); } } } } RoleDataSeeder class designed to populate the database with roles if they don't