Select Hibernate super simples(RESOLVIDO)

3 respostas
F

tabela t_artista…
so tem cod e nome

public List TodosArtistas() {
        Session session = hibernate.HibernateUtil.currentSession();
        org.hibernate.Query query = session.createQuery(
                " select artista " +
                " from  " +
                " Artista as artista ");
        
        return query.list();
    }

ta retornando vazio…
Hibernate realmente é fora de serie, mas ate aprender é uma @#$%!!!
obrigado!!

3 Respostas

glaucioguerra

Tente “from Artista” na query.

Um abraço!

albertongai

se vc vai fazer um select * from… vc pode omitir a clausula “select *” , use apenas “from tabelax” , que deve funcionar do mesmo jeito!

se mesmo ainda não tiver funcionando o nome da tabela no seu mapeamento está diferente…

[]´s

Alberto

F

Valeu!! funcionou aqui

Criado 6 de junho de 2006
Ultima resposta 6 de jun. de 2006
Respostas 3
Participantes 3