[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6714) Parentheses dissapear in simple JPQL update query where they should stay
Peter Gwiazda (JIRA)
noreply at atlassian.com
Thu Oct 6 03:28:20 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43965#comment-43965 ]
Peter Gwiazda commented on HHH-6714:
------------------------------------
Of course the workaround is :
{noformat}
update WorkMessage workMessage set workMessage.earnedPrice = - workMessage.totalCost + :a1
{noformat}
but this is still a bug
> Parentheses dissapear in simple JPQL update query where they should stay
> ------------------------------------------------------------------------
>
> Key: HHH-6714
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6714
> Project: Hibernate Core
> Issue Type: Bug
> Components: entity-manager
> Affects Versions: 3.6.7, 4.0.0.CR4
> Environment: Tried on Hibernate 3.6.7 and 4.0.0.CR4 with PostgreSQL database
> Reporter: Peter Gwiazda
> Labels: HQL, jpa2
>
> I create simple update query
> {noformat}
> em.createQuery("update WorkMessage workMessage set workMessage.earnedPrice = -( workMessage.totalCost - :a1 )")
> .setParameter("a1", 12.0f)
> .executeUpdate();
> {noformat}
> and the SQL is (yelled by hibernate log)
> {noformat}
> 09:18:10.880 [main] DEBUG org.hibernate.SQL - update work_message set earned_price=-total_cost-?
> {noformat}
> {{- total_cost - 12}} is not the same as {{- (total_cost - 12)}}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list