Recuperando valor do Map

1 resposta
E
public  class CriaConex implements Serializable {
   
    private static Map<String, EntityManagerFactory> mapafabent = new HashMap<String, EntityManagerFactory>();
    
...

    @PostConstruct
    @Override
    public void init() {
           mapa.put("javax.persistence.jdbc.user", "Usuario");
           CriaConex.getMapafabent().put("Votup", Persistence.createEntityManagerFactory("planouni", mapa));                                 
    
    }

    public static Map<String, EntityManagerFactory> getMapafabent() {
        return mapafabent;
    }

}

public class GerenciaTransacaoInterceptor implements InterfaceAbstrata, Serializable {

    private CriaConex conex;
    @EJB
    private ServicoUtils utils;



    String key = "demo";
Gostaria de carregar a o valor do getMapafabent "Votup" e isso seria o conteudo da minha variavel key

1 Resposta

B

O contrário de “put” é “get”

Criado 22 de janeiro de 2013
Ultima resposta 22 de jan. de 2013
Respostas 1
Participantes 2