Boa noite. Estou com problema no selectOneMenu, ele não esta carregando os itens que estão no DB
<h:selectOneMenu id="seletc_uf" value="#{ufBean.uf.uf_sigla}">
<f:selectItem itemValue="" itemLabel="Selecione..." />
<f:selectItems value="#{ufBean.listarUf}" />
</h:selectOneMenu>
meu UfBean
@ManagedBean(value="ufBean")
@ViewScoped
public class UfBean {
private Locale currentLocale = new Locale("pt", "BR");
private Uf uf = new Uf();
@SuppressWarnings("rawtypes")
private DataModel listarUf;
public void portugueseLocale() {
UIViewRoot viewRoot = FacesContext.getCurrentInstance().getViewRoot();
currentLocale = new Locale("pt", "BR");
viewRoot.setLocale(currentLocale);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public DataModel getListarUf() {
List<Uf> lista = new UfDao().listarUf();
listarUf = new ListDataModel(lista);
return listarUf;
}
public void setListarUf(@SuppressWarnings("rawtypes") DataModel listarUf) {
this.listarUf = listarUf;
}
public Uf getUf() {
return uf;
}
public void setUf(Uf uf) {
this.uf = uf;
}
}
Meu UfDao
public class UfDao {
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<Uf> listarUf(){
try{
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
Transaction t = session.beginTransaction();
List lista = session.createQuery("from uf_estado").list();
t.commit();
return lista;
}catch(HibernateException e){
System.out.println("DEU MERDA NO LISTAR UF DAO .Erro: >>>>>>"+e);
}
return null;
}
}
Alguém pode da uma ajuda?
Obrigado