-->
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.  [ 3 posts ] 
Author Message
 Post subject: Tabelle wird nicht gemapt
PostPosted: Mon Jan 16, 2006 6:12 am 
Newbie

Joined: Thu Jan 12, 2006 12:55 pm
Posts: 2
Hallo,

dieses Problem tritt bei mir auf, obwohl ich mich an den Aufbau der Tutorials von www.hibernate.org halte.

Hibernate version:
Hibernate 3

Mapping documents:
hibernate.cfg.xml:
<mapping resource="snare/webInterface/database/Sequences.hbm.xml" />
Sequences.hbm.xml:
<class name="snare.webInterface.database.Sequences" table="sequences">

Code between sessionFactory.openSession() and session.close():
session.beginTransaction();
ArrayList rs = (ArrayList)session.createQuery("FROM sequences s").list();
session.beginTransaction().commit();

Full stack trace of any exception that occurs:
javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'snare.webInterface.database.SequencesData'.. class snare.webInterface.database.SequencesData : org.hibernate.hql.ast.QuerySyntaxException: sequences is not mapped. [FROM sequences s]
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:842)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.snarePage_jsp._jspService(snarePage_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198

Name and version of the database you are using:
MySql 5.0.15-0

Alle im Netz befindlichen Lösungen haben mir nicht weiter geholfen. Ich hoffe hier kann mir jemand helfen.
Vielen Dank!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 7:42 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:52 am
Posts: 52
Location: Zurich
Quote:
ArrayList rs = (ArrayList)session.createQuery("FROM sequences s").list();

aendern in:
ArrayList rs = (ArrayList)session.createQuery("FROM Sequences s").list();

Bei createQuery musst du HQL benutzen, bei createSQLQuery verwendest du SQL.

Urs


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 8:38 am 
Newbie

Joined: Thu Jan 12, 2006 12:55 pm
Posts: 2
Es hat funktioniert!
Vielen Dank!


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

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.