Welcome to Dream.In.Code
Click Here
Getting Java Help is Easy!

Join 117,542 Java Programmers for FREE! Ask your question and get quick answers from experts. There are 1,699 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



HQL - help

 
Reply to this topicStart new topic

HQL - help, I have problem with Select Query

E_milcheva
post 5 May, 2008 - 05:59 AM
Post #1


New D.I.C Head

*
Joined: 5 May, 2008
Posts: 1

public static List<Car> getAllCars(Session hibSession) {
Query query = hibSession.createQuery("select distinct marka from Car");
return (List<Car>) query.list();
}

here is the ERROR:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
\-[IDENT] IdentNode: 'marka' {originalText=marka}
org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:140)
org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:702)
org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:531)
org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)
access.AccessCars.getAllCars(AccessCars.java:14)
servlets.IndexServlet.doGet(IndexServlet.java:19)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.14

What should I do?
User is offlineProfile CardPM

Go to the top of the page


PsychoCoder
post 5 May, 2008 - 06:02 AM
Post #2


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,831



Thanked 80 times

Dream Kudos: 8050

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


Moved to Java smile.gif
User is online!Profile CardPM

Go to the top of the page

1lacca
post 5 May, 2008 - 06:26 AM
Post #3


code.rascal

Group Icon
Joined: 11 Aug, 2005
Posts: 3,804



Thanked 11 times
My Contributions


I'd guess you don't have a hibernate mapping for marka.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 05:25PM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month