-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Error Code in Java 5 update 3
PostPosted: Wed May 18, 2005 10:01 am 
Beginner
Beginner

Joined: Wed May 18, 2005 9:48 am
Posts: 31
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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.