You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by ignicolist <ig...@gmail.com> on 2007/08/10 22:02:17 UTC
Loading Object with hibernate Help
Hibernate version: hibernate-3.2.4
Name and version of the database : mysql
Hi i know that this is no the place for this question, but i dont find here
another place so if anyone could help a apreciate, i have this code:
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
List s = session.createQuery("from Schedule").list();
session.getTransaction().commit();
for (int i = 0; i < s.size(); i++) {
Schedule xx = (Schedule) s.get(i); //HERROR HERE
System.out.println("End: " + ss.getEndTime() +
" Start: " + ss.getStartTime());
}
The error is in Schedule xx = (Schedule) s.get(i); any idea why this don´t
work? the list s have the values, the cicle work fine, but Schedule xx =
(Schedule) s.get(i); dont work!!!
Any Help please!
--
View this message in context: http://www.nabble.com/Loading-Object-with-hibernate-Help-tf4250794.html#a12098131
Sent from the My Faces - Dev mailing list archive at Nabble.com.
Re: Loading Object with hibernate Help
Posted by David Delbecq/jakarta <de...@oma.be>.
http://www.hibernate.org/20.html#A2
Le 10 août 07 à 22:02, ignicolist a écrit :
>
> Hibernate version: hibernate-3.2.4
>
> Name and version of the database : mysql
>
> Hi i know that this is no the place for this question, but i dont
> find here
> another place so if anyone could help a apreciate, i have this code:
>
> Session session = HibernateUtil.getSessionFactory
> ().getCurrentSession();
>
> session.beginTransaction();
>
> List s = session.createQuery("from Schedule").list();
>
> session.getTransaction().commit();
>
>
>
> for (int i = 0; i < s.size(); i++) {
> Schedule xx = (Schedule) s.get(i); //HERROR HERE
>
> System.out.println("End: " + ss.getEndTime() +
> " Start: " + ss.getStartTime());
> }
>
> The error is in Schedule xx = (Schedule) s.get(i); any idea why
> this don´t
> work? the list s have the values, the cicle work fine, but Schedule
> xx =
> (Schedule) s.get(i); dont work!!!
>
> Any Help please!
>
>
>
> --
> View this message in context: http://www.nabble.com/Loading-Object-
> with-hibernate-Help-tf4250794.html#a12098131
> Sent from the My Faces - Dev mailing list archive at Nabble.com.
>
Re: Loading Object with hibernate Help
Posted by ignicolist <ig...@gmail.com>.
ANY help please?
ignicolist wrote:
>
> Hibernate version: hibernate-3.2.4
>
> Name and version of the database : mysql
>
> Hi i know that this is no the place for this question, but i dont find
> here another place so if anyone could help a apreciate, i have this code:
>
> Session session = HibernateUtil.getSessionFactory().getCurrentSession();
>
> session.beginTransaction();
>
> List s = session.createQuery("from Schedule").list();
>
> session.getTransaction().commit();
>
>
>
> for (int i = 0; i < s.size(); i++) {
> Schedule xx = (Schedule) s.get(i); //HERROR HERE
>
> System.out.println("End: " + ss.getEndTime() +
> " Start: " + ss.getStartTime());
> }
>
> The error is in Schedule xx = (Schedule) s.get(i); any idea why this don´t
> work? the list s have the values, the cicle work fine, but Schedule xx =
> (Schedule) s.get(i); dont work!!!
>
> Any Help please!
>
> I folow this tutorial:
> http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html#tutorial-firstapp-workingpersistence
> Hibernate
>
>
>
>
--
View this message in context: http://www.nabble.com/Loading-Object-with-hibernate-Help-tf4250794.html#a12103268
Sent from the My Faces - Dev mailing list archive at Nabble.com.