posted 16 years ago
If you have a query like "Select user.id, user.firstname, user.password, user.emailaddress from UserBean where ...", then you will get back an Object[], not a UserBean, as was pointed out above.
If you want an array of UserBean objects, change the query to something like "from UserBean where ..." (without the SELECT part).
If you want one particular UserBean, you can use "(UserBean) sess.load(UserBean.class, user.id)", assuming user.id is the primary key of UserBean.
Liastly, the name of the method for getting the next element of an Iterator is not netxElement, as you found out, but can easily be determined by looking at the javadocs.