Hi all,
yesterday I'd migrated my Java 5 update2 with netbeans 4.0 to Java 5 update 3 with netbeans 4.1 . My problem is that i get an error in java 5 update 3 where with old java 5 update 2 don't was, exactly in session.load
My source code is this:
HibernateUsuariosDAO.java
public tUsuarios readUser(int Num_Emple) throws oExceptionIntranet {
Session session = null;
tUsuarios user = null;
Transaction tx = null;
try {
session = factory.openSession();
tx = session.beginTransaction();
user=(tUsuarios)session.load(tUsuarios.class,Num_Emple); -->Here is the error
tx.commit();
}
catch(Exception e) {
if (tx != null) {
try {
tx.rollback();
}
catch (HibernateException e1) {
throw new oExceptionIntranet(e1.toString());
}
}
throw new oExceptionIntranet(e.toString());
}
finally {
if (session != null) {
try {
session.close();
}
catch (HibernateException e) {
}
}
}
tUsuarios.java
package BBDD.SERVICES.TABLAS;
import java.io.Serializable;
/**
*
* @author Administrador
*/
public class tUsuarios implements Serializable {
private int iNum_Emple;
private String sClave="";
private String sFecha="";
private int iId_Perfil;
public int getNum_Emple(){
return iNum_Emple;
}
......
tUsuariosServices.java
public static tUsuarios getUser(int iNum_Emple)
throws oExceptionIntranet {
tUsuarios tusuarios = null;
try {
HibernateUsuariosDAO dao = HibernateUsuariosDAO.getInstance();
tusuarios = dao.readUser(iNum_Emple);
}
catch (Exception e) {
throw new oExceptionIntranet(e.toString());
}
return tusuarios;
}
Error shown is:
D:\Netbeans\intranet\src\java\BBDD\DATA\HibernateUsuariosDAO.java:93: cannot find symbol
symbol : method load(java.lang.Class,int)
location: interface org.hibernate.Session
user=(tUsuarios)session.load(tUsuarios.class,Num_Emple);
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
what's problems between two versions?.
Thx.
Hibernate version: 3.0.3
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|