-->
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.  [ 6 posts ] 
Author Message
 Post subject: Batch updates and Components?
PostPosted: Wed May 04, 2005 10:36 am 
Newbie

Joined: Wed Aug 11, 2004 7:01 am
Posts: 10
Hibernate version:
3.0.2

Code between sessionFactory.openSession() and session.close():
Query query = getSession().createQuery("update advert set cbmLink.model=:model, cbmLink.alternateModelName=:modelName where cbmLink.brand=:brand and cbmLink.alternateModelName=:alternateModelName");
query.setEntity("model", model);
query.setString("modelName", null);
query.setEntity("brand", alternateModel.getBrand());
query.setString("alternateModelName", alternateModel.getAlternateModelName());
query.executeUpdate();

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

The generated SQL (show_sql=true):
none that is the problem ;)


Trying to do a batch update of two component properties of an entity. But hibernate does seem to have a HQL parsing problem, it doesn't like the component selection part.

The folowing error is given:
ErrorCounter.java:35 - *** ERROR: line 1:26: expecting EQ, found '.'

Any idea?

/Kristoffer


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 10:38 am 
Newbie

Joined: Wed Aug 11, 2004 7:01 am
Posts: 10
More info from the log.

/Kristoffer




java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:300)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:166)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at sherlock.backend.security.SecurityInterceptor.intercept(SecurityInterceptor.java:113)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:237)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind._ha.doFilter(.:59)
at framework.authfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:193)
at com.evermind._gz.doFilter(.:16)
at framework.webwork.filter.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:34)
at com.evermind._gz.doFilter(.:20)
at com.opensymphony.webwork.lifecycle.RequestLifecycleFilter.doFilter(RequestLifecycleFilter.java:67)
at com.evermind._gz.doFilter(.:20)
at framework.util.filter.P3PFilter.doFilter(P3PFilter.java:33)
at com.evermind._gz.doFilter(.:20)
at framework.util.filter.NoCacheFilter.doFilter(NoCacheFilter.java:33)
at com.evermind._ctb._psd(.:383)
at com.evermind._ctb._bqc(.:177)
at com.evermind._ax._luc(.:668)
at com.evermind._ax._ucb(.:193)
at com.evermind._bf.run(.:62)
Caused by: java.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.recover(Lantlr/RecognitionException;Lantlr/collections/impl/BitSet;)V
at org.hibernate.hql.antlr.HqlBaseParser.assignment(HqlBaseParser.java:400)
at org.hibernate.hql.antlr.HqlBaseParser.setClause(HqlBaseParser.java:333)
at org.hibernate.hql.antlr.HqlBaseParser.updateStatement(HqlBaseParser.java:182)
at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:133)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:422)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:822)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:810)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
at sherlock.backend.service.CategoryServiceImpl.upgradeModel(CategoryServiceImpl.java:1571)
at sherlock.backend.action.admin.category.ListAlternateModelAction.upgrade(ListAlternateModelAction.java:63)
... 39 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 1:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Referencing components in UPDATE/DELETE statements is currently not supported.

It should be in the next release after 3.0.3, which will be either 3.0.4 or 3.1


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 1:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Err, slight correction: referencing components "in the SET clause" is currently not supported...


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 23, 2005 9:43 am 
Newbie

Joined: Wed Aug 11, 2004 7:01 am
Posts: 10
Was this fixed in release 3.0.4?

/Kristoffer


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 10:10 am 
Newbie

Joined: Wed Aug 11, 2004 7:01 am
Posts: 10
steve wrote:
Referencing components in UPDATE/DELETE statements is currently not supported.

It should be in the next release after 3.0.3, which will be either 3.0.4 or 3.1


Is this included in 3.0.4 or 3.0.5? or?

/Kristoffer


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