my dog learned polymorphism
The moose likes Object Relational Mapping and the fly likes Hibernate error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate error" Watch "Hibernate error" New topic

Hibernate error

rodrigo bengoechea

Joined: Nov 15, 2008
Posts: 10
Hi everyone! I'm developing my first web application using hibernate and as everybody would know hibernate is not friendly at all for begginers. I'm stuck with this error and I can't figure out where's my mistake, so if someone has any idea it would be very helpful.

Basically, what I'm trying to do is to know if there's a group named as the parameter:

This is the error that I'm getting:
19:44:46,968 INFO [STDOUT] Hibernate:
select as id2_, as name2_,
group0_.category as category2_,
group0_.creation_date as creation4_2_,
group0_.admin_id as admin5_2_

Group group0_ where
19:44:47,062 INFO [STDOUT] 19:44:47,062 WARN [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
19:44:47,078 INFO [STDOUT] 19:44:47,078 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group group0_ where'MRC'' at line 1
19:45:43,031 INFO [STDOUT] 19:45:43,031 WARN [RequestProcessor] Unhandled Exception thrown: class org.hibernate.exception.SQLGrammarException
19:45:43,031 ERROR [[action]] Servlet.service() para servlet action lanz� excepci�n
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group group0_ where'MRC'' at line 1
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.sendCommand(
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
at com.mysql.jdbc.ConnectionImpl.execSQL(
at com.mysql.jdbc.PreparedStatement.executeInternal(
at com.mysql.jdbc.PreparedStatement.executeQuery(
at org.hibernate.jdbc.AbstractBatcher.getResultSet(
at org.hibernate.loader.Loader.getResultSet(
at org.hibernate.loader.Loader.doQuery(
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(
at org.hibernate.loader.Loader.doList(
at org.hibernate.loader.Loader.listIgnoreQueryCache(
at org.hibernate.loader.Loader.list(
at org.hibernate.loader.hql.QueryLoader.list(
at org.hibernate.hql.ast.QueryTranslatorImpl.list(
at org.hibernate.engine.query.HQLQueryPlan.performList(
at org.hibernate.impl.SessionImpl.list(
at org.hibernate.impl.QueryImpl.list(
at dao.GroupDAOImpl.groupExists(
at services.ServiceImpl.groupExists(
at action.createGroup.CreateGroupAction.execute(
at org.apache.struts.action.RequestProcessor.processActionPerform(
at org.apache.struts.action.RequestProcessor.process(
at org.apache.struts.action.ActionServlet.process(
at org.apache.struts.action.ActionServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)

Here's the Group Class:

And here the hbm:

Please any suggestion will help me a lot!!

Thanks everyone in advance!
I agree. Here's the link:
subject: Hibernate error
It's not a secret anymore!