Aew… nao aguento mais to quase desistindo disso kkk
to tentando fazer o hibernate 3 funcionar so que da um erro …
minha classe:
@Entity
public class Usuario {
@Id
@GeneratedValue
private int id;
private String nome;
minha dao so para cadastrar!!
[code]public class UsuarioDAO {
public void cadastrar()
{
AnnotationConfiguration conf = new AnnotationConfiguration();
conf.configure();
SessionFactory factory = conf.buildSessionFactory();
Session session = factory.openSession();
Usuario usuario = new Usuario();
usuario.setNome("Rodrigo");
Transaction t = session.beginTransaction();
session.save(usuario);
t.commit();
session.close();
}
}[/code]
meu cfg:
[code]<?xml version="1.0" encoding="UTF-8"?>
org.hibernate.dialect.MySQLDialect com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/medial root master [/code]e aonde eu estou chamando o metodo acho de pouca relevancia… mais… no desespero kk
[code]@Component
public class UsuarioLogic {
@Viewless
public void cadastar(){
UsuarioDAO dao = new UsuarioDAO();
dao.cadastrar();
}
}[/code]
o erro!
[quote]descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org/hibernate/annotations/common/reflection/ReflectionManager
root cause
java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager
root cause
java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ReflectionMana[/quote]