ORM SQLGrammarException

81 views
Skip to first unread message

Spectre013

unread,
Feb 1, 2011, 4:51:42 PM2/1/11
to Railo
Just trying to do some simple orm examples to begin researching it for
a project. Created my cfc for my database and just wanted to load the
1 row in the table using EntityLoad("payPeriods");

that results in the StackTrace Below.

Server is running 3.2.1.003 and I just updated the jars before sending
this message.

Any help would be appreciated. Let me know if you need more
information.

Thanks
Brian

could not execute query
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936):936
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2934):2934
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616):1616
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708):1708
at com.mysql.jdbc.Connection.execSQL(Connection.java:3255):3255
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:
1293):1293
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
1428):1428
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
208):208
at org.hibernate.loader.Loader.getResultSet(Loader.java:1869):1869
at org.hibernate.loader.Loader.doQuery(Loader.java:718):718
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:
270):270
at org.hibernate.loader.Loader.doList(Loader.java:2449):2449
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192):
2192
at org.hibernate.loader.Loader.list(Loader.java:2187):2187
at
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:
119):119
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706):1706
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347):347
at
railo.runtime.orm.hibernate.HibernateORMSession.load(HibernateORMSession.java:
675):675
at
railo.runtime.orm.hibernate.HibernateORMSession.loadAsArray(HibernateORMSession.java:
485):485
at
railo.runtime.orm.hibernate.HibernateORMSession.loadAsArray(HibernateORMSession.java:
454):454
at railo.runtime.functions.orm.EntityLoad.call(EntityLoad.java:18):18
at index_cfm$cf.call(/var/www/vhosts/f.brianpaulson.com/httpdocs/
index.cfm:2):2
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:736):
736
at
railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:
205):205
at
railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:
23):23
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1973):
1973
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:
280):280
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91):91
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:
103):103
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:
175):175
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
240):240
at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:
424):424
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481):
481
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685):685
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607):607
at java.lang.Thread.run(Thread.java:619):619
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:
92):92
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
66):66
at org.hibernate.loader.Loader.doList(Loader.java:2452):2452
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192):
2192
at org.hibernate.loader.Loader.list(Loader.java:2187):2187
at
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:
119):119
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706):1706
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347):347
at
railo.runtime.orm.hibernate.HibernateORMSession.load(HibernateORMSession.java:
675):675
at
railo.runtime.orm.hibernate.HibernateORMSession.loadAsArray(HibernateORMSession.java:
485):485
at
railo.runtime.orm.hibernate.HibernateORMSession.loadAsArray(HibernateORMSession.java:
454):454
at railo.runtime.functions.orm.EntityLoad.call(EntityLoad.java:18):18
at index_cfm$cf.call(/var/www/vhosts/f.brianpaulson.com/httpdocs/
index.cfm:2):2
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:736):
736
at
railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:
205):205
at
railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:
23):23
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1973):
1973
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:
280):280
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91):91
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:
103):103
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:
175):175
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
240):240
at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:
424):424
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481):
481
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685):685
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607):607
at java.lang.Thread.run(Thread.java:619):619
at railo.runtime.op.Caster.toPageException(Caster.java:2987):2987
at
railo.runtime.orm.hibernate.HibernateORMSession.load(HibernateORMSession.java:
684):684
at
railo.runtime.orm.hibernate.HibernateORMSession.loadAsArray(HibernateORMSession.java:
485):485
at
railo.runtime.orm.hibernate.HibernateORMSession.loadAsArray(HibernateORMSession.java:
454):454
at railo.runtime.functions.orm.EntityLoad.call(EntityLoad.java:18):18
at index_cfm$cf.call(/var/www/vhosts/f.brianpaulson.com/httpdocs/
index.cfm:2):2
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:736):
736
at
railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:
205):205
at
railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:
23):23
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1973):
1973
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:
280):280
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91):91
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:
103):103
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:
175):175
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
240):240
at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:
424):424
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481):
481
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685):685
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607):607
at java.lang.Thread.run(Thread.java:619):619

Todd Rafferty

unread,
Feb 1, 2011, 6:28:47 PM2/1/11
to ra...@googlegroups.com
ORM is case sensitive I believe. Is there a table called "payPeriods"?

What does the actual cfc contain?

Spectre013

unread,
Feb 1, 2011, 7:48:14 PM2/1/11
to Railo
Todd,

The table is named "payPeriods" the cfc is "payPeriods.cfc" and its
being called "p = EntityLoad("payPeriods");"

Contents of payPeriods.cfc

component displayname="payPeriods" hint="I am a model of a Pay
Periods" output="false" persistent="true"
{
property name="id" generator="increment" ormtype="int";
property name="payDate" ormtype="date";
property name="payAmount" ormtype="float";
}


Thanks
Brian

Todd Rafferty

unread,
Feb 1, 2011, 8:24:37 PM2/1/11
to ra...@googlegroups.com
When you updated the jars, did you restart the server?
--
~Todd Rafferty
Volunteer
Community Manager
Railo Server - Open Source
----

Spectre013

unread,
Feb 2, 2011, 9:37:32 AM2/2/11
to Railo
Yes, shut it down, replaced jars then restarted server.

Brian

On Feb 1, 6:24 pm, Todd Rafferty <t...@getrailo.org> wrote:
> When you updated the jars, did you restart the server?
>
>
>
>
>
>
>
>
>
> On Tue, Feb 1, 2011 at 7:48 PM, Spectre013 <br...@brianpaulson.com> wrote:
> > Todd,
>
> >  The table is named "payPeriods" the cfc is "payPeriods.cfc" and its
> > being called "p = EntityLoad("payPeriods");"
>
> > Contents of payPeriods.cfc
>
> > component displayname="payPeriods" hint="I am a model of a Pay
> > Periods" output="false" persistent="true"
> > {
> >    property name="id" generator="increment" ormtype="int";
> >    property name="payDate" ormtype="date";
> >    property name="payAmount" ormtype="float";
> > }
>
> > Thanks
> > Brian
>
> > On Feb 1, 4:28 pm, Todd Rafferty <t...@getrailo.org> wrote:
> > > ORM is case sensitive I believe. Is there a table called "payPeriods"?
>
> > > What does the actual cfc contain?
>
> --
> ~Todd Rafferty*
> Volunteer** *Community Manager

Spectre013

unread,
Feb 2, 2011, 10:06:27 AM2/2/11
to Railo
ok, solved the issue not sure if its a bug in hibernate or Railo but
even though I was referencing table,cfc and load statement as
payPeriods it was looking for the table payperiods. I recreated the
table all lower case and it worked just fine.

It would seems that its converting the name of the entity to lowercase
when doing the query.

Brian

On Feb 1, 6:24 pm, Todd Rafferty <t...@getrailo.org> wrote:
> When you updated the jars, did you restart the server?
>
>
>
>
>
>
>
>
>
> On Tue, Feb 1, 2011 at 7:48 PM, Spectre013 <br...@brianpaulson.com> wrote:
> > Todd,
>
> >  The table is named "payPeriods" the cfc is "payPeriods.cfc" and its
> > being called "p = EntityLoad("payPeriods");"
>
> > Contents of payPeriods.cfc
>
> > component displayname="payPeriods" hint="I am a model of a Pay
> > Periods" output="false" persistent="true"
> > {
> >    property name="id" generator="increment" ormtype="int";
> >    property name="payDate" ormtype="date";
> >    property name="payAmount" ormtype="float";
> > }
>
> > Thanks
> > Brian
>
> > On Feb 1, 4:28 pm, Todd Rafferty <t...@getrailo.org> wrote:
> > > ORM is case sensitive I believe. Is there a table called "payPeriods"?
>
> > > What does the actual cfc contain?
>
> --
> ~Todd Rafferty*
> Volunteer** *Community Manager
Reply all
Reply to author
Forward
0 new messages