[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3584) Generate SQL when Dynamic Update is true is including version field even when marked as updateable=false
Dave Stephan (JIRA)
noreply at atlassian.com
Tue Jan 27 17:08:39 EST 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32203#action_32203 ]
Dave Stephan commented on HHH-3584:
-----------------------------------
fixed in trunk / 3.3 / 3.2 / 3.2cp
> Generate SQL when Dynamic Update is true is including version field even when marked as updateable=false
> --------------------------------------------------------------------------------------------------------
>
> Key: HHH-3584
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3584
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.2.4.sp1, 3.2.6, 3.3.1
> Reporter: Dave Stephan
> Assignee: Dave Stephan
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: AbstractPersister_3_2.txt, AbstractPersister_3_2_4_SP1_CP.txt, AbstractPersister_3_3.txt, AbstractPersister_trunk.txt
>
>
> If an entity has the annotation:
> @Enitity(dynamicUpdate=true)
> And a field annotated as :
> @Version
> @Generated(GenerationTime.Always)
> @Column(updateable=false, insertable=false)
> The generated update sql will include the annotated field in the properties to be updated. This is incorrect and causes exceptions in certain cases. E.g updating a view where the resulting columns cross multiple tables.
> When the dynamicUpdate is set to true, the sql string is generated dynamically and initially the field marked as updateable=false is flagged as not to be included. The AbstractEntityPersiter.getPropertiesToUpdate method then checks if there is a versioning field, finds the above annotated column and now flags it to be included, neglecting to check whether this versioning field has also been marked as updateable=false, or whether @Generated(GenerationTime.ALWAYS) is there. (Although the last isn't really necessary as this annotation can't be there without the column being marked as not updateable and not insertable.)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list