package com.example;

import javax.persistence.ElementCollection;
import javax.persistence.FetchType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.List;

@Entity
public class Acceso {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;
	
	private String login;
	private String passwordHash;
	
	@ElementCollection(fetch = FetchType.EAGER)
	private List<String> roles;
	
	public Acceso(){
		
	}
	public Acceso (String login, String password){
		super();
		this.login = login;
		this.passwordHash = password;
	}
	
	public String getLogin() {
		return login;
	}
	
	public void setLogin(String login) {
		this.login = login;
	}
	
	public String getPassword() {
		return passwordHash;
	}
	
	public void setPassword(String password) {
		this.passwordHash = password;
	}
	
	@Override
	public String toString(){ 
		return "Acceso [login=" + login + ", password=" + passwordHash + "]";
	}
}

@@ -14,16 +14,232 @@
 xample;%0D
+%0Aimport com.example.*;%0D%0A%0D%0A//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;%0D%0Aimport org.springframework.stereotype.Component;%0D%0Aimport org.springframework.web.context.annotation.SessionScope;%0D
 %0A%0D%0Aimpor
@@ -463,16 +463,18 @@
 ce.Id;%0D%0A
+%0D%0A
 import j
@@ -493,17 +493,99 @@
 t;%0D%0A
-%0D%0A@Entity
+import java.util.ArrayList;%0D%0Aimport java.util.Arrays;%0D%0A%0D%0A@Entity%0D%0A@Component%0D%0A@SessionScope
 %0D%0Apu
@@ -605,16 +605,19 @@
 ceso %7B%0D%0A
+%09%0D%0A
 %09@Id%0D%0A%09@
@@ -730,28 +730,24 @@
 ing password
-Hash
 ;%0D%0A%09%0D%0A%09@Elem
@@ -815,24 +815,30 @@
  roles;%0D%0A%09%0D%0A
+%09%0D%0A%09%0D%0A
 %09public Acce
@@ -897,16 +897,30 @@
 password
+, String roles
 )%7B%0D%0A%09%09su
@@ -957,36 +957,32 @@
 %0A%09%09this.password
-Hash
  = password;%0D%0A%09%7D
@@ -971,32 +971,89 @@
 rd = password;%0D%0A
+%09%09this.roles = new ArrayList%3C%3E(Arrays.asList(roles));%0D%0A%0D%0A
 %09%7D%0D%0A%09%0D%0A%09public S
@@ -1214,20 +1214,16 @@
 password
-Hash
 ;%0D%0A%09%7D%0D%0A%09
@@ -1284,20 +1284,16 @@
 password
-Hash
  = passw
@@ -1305,16 +1305,150 @@
 %0A%09%7D%0D%0A%09%0D%0A
+%09public List%3CString%3E getRoles() %7B%0D%0A%09%09return roles;%0D%0A%09%7D%0D%0A%09%0D%0A%09public void setRoles(List%3CString%3E roles) %7B%0D%0A%09%09this.roles = roles;%0D%0A%09%7D%0D%0A%09%0D%0A
 %09@Overri
@@ -1544,12 +1544,8 @@
 word
-Hash
  + %22

Update Acceso.java