-->
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.  [ 2 posts ] 
Author Message
 Post subject: Newbie issue - select statement
PostPosted: Tue Apr 26, 2005 8:32 am 
Newbie

Joined: Tue Apr 26, 2005 8:26 am
Posts: 2
Location: Knaresborough, UK
I'm a real n00b to Hibernate and I am just messing around, but I have got myself stuck here and I know the answer is going to be really obvious.

Anyone got any ideas?

Cheers
Dan


Hibernate version:
3

Mapping documents:
<class name="com.howellsassociates.resourcebooking.usermanagement.objects.GroupObject" table="GROUPS">
<id name="groupID" type="string">
<column name="groupID"/>
</id>
<property name="groupName" column="groupName" type="string"/>
<property name="createdDate" column="createdDate" type="date"/>
<property name="modifiedDate" column="modifiedDate" type="date"/>

<set name="permissions" table="GROUP_PERMISSIONS" lazy="true">
<key column="groupID"/>
<many-to-many class="com.howellsassociates.resourcebooking.usermanagement.objects.PermissionObject" column="permissionID"/>
</set>

</class>

Full stack trace of any exception that occurs:
org.hibernate.hql.ast.QuerySyntaxError: unexpected token: group near line 1, column 8 [select group from com.howellsassociates.resourcebooking.usermanagement.objects.GroupObject as group]
org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:74)
org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:214)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:414)
org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:814)
org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:850)
org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:41)
com.howellsassociates.resourcebooking.usermanagement.UserManagementLogic.getGroups(UserManagementLogic.java:51)
com.howellsassociates.resourcebooking.usermanagement.UserManagementServlet.doGet(UserManagementServlet.java:31)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Name and version of the database you are using:
MySQL 4.1.11

HQL:

//get the groups
String selectQuery = "select group from com.howellsassociates.resourcebooking.usermanagement.objects.GroupObject as group";


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 8:47 am 
Newbie

Joined: Tue Apr 26, 2005 8:26 am
Posts: 2
Location: Knaresborough, UK
Excuse my dense nature!

"group" is reserved!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.