Erro ao efetuar login com Hibernate

Olá pessoal gostaria de saber como resolver isso e se pra verificar a senha é como eu coloquei em comentarios na linha 7.

public UsuarioVO checarDados(String login, String senha) throws SQLException { try { DAOFactory dao = new DAOFactory(); dao.beginTransaction(); String hql = "from UsuarioVO as user where user.login = '"+login+"'";// and user.password = '"+senha+"'"; Query q = session.createQuery(hql); usuarioVO = (UsuarioVO) q.uniqueResult(); dao.commit(); dao.close(); return usuarioVO; } catch (Exception e) { e.printStackTrace(); return null; } }

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        try {
            String usuario = tf_login.getText();
            String senha = new String(pf_senha.getPassword());

            if (checarDados(usuario, senha) != null) {
                TelaPrincipal tela = new TelaPrincipal();
                tela.entrar(usuarioVO);
            } else {
                JOptionPane.showMessageDialog(null, "Dados incorretos");
            }
    
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "Erro: "+ex);
        }
}
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 27/05/2006 16:45:18 by Hibernate Tools 3.1.0 beta3 -->
<hibernate-mapping>
	<class name="VO.UsuarioVO" table="usuarios" schema="public">
                <id name="id" type="integer">
			<column name="id" />
			<generator class="assigned" />
		</id>
		<property name="login" type="java.lang.String"/>
                <property name="password" type="java.lang.String"/>
                <property name="permissao" type="integer"/>
        </class>
</hibernate-mapping>

Ah, existe um getId em UsuarioVO

Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for id in class VO.UsuarioVO
        at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
        at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
        at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:168)
        at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
        at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:123)
        at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
        at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
        at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
        at DAO.HibernateUtil.<clinit>(HibernateUtil.java:14)
        ... 44 more

Abraços

Faz tempo que não uso esse xml do hibernate, mas me pareceu estranho o seguinte [quote]<class name=“VO.UsuarioVO”[/quote]. Não deveria ser class name=“UsuarioVO”?

nao, pois esta no pacote VO

ai fica VO.UsuarioVO

abraços

Mas o nome todo do pacote é VO?

Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for id in class VO.UsuarioVO 

Falta na classe UsuarioVO um getter para o atributo id.

Se estiver usando um long seria algo assim:

public class UsuarioVO{
private long id;
//O resto da classe
public long getId(){
return id;
}
}

valeu

resolvido