[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3179) Incorrect SQL using formula in component or as key with optimistic-lock="dirty"

Heinz Huber (JIRA) noreply at atlassian.com
Thu Mar 13 17:04:34 EDT 2008


Incorrect SQL using formula in component or as key with optimistic-lock="dirty"
-------------------------------------------------------------------------------

                 Key: HHH-3179
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3179
             Project: Hibernate3
          Issue Type: Bug
    Affects Versions: 3.2.6
         Environment: Hibernate 3.2.6ga
Oracle 10i (should not matter)
            Reporter: Heinz Huber
         Attachments: association-formula.zip

Don't generate null as column name for formulas on dirty optimisic locking.
Effect: If a component (or an association) used for the generation of the where clause for optimistic locking by dirty properties contained a formula, null would have been inserted as column name. Now these values are skipped.
Example: 
	<class name="Verfueger" table="ELVFGR" dynamic-insert="true" dynamic-update="true" select-before-update="true" optimistic-lock="dirty"
		rowid="rowid">
		<composite-id name="nummer">
			<key-many-to-one name="mandant" column="vfMand" />
			<key-property name="anlagekennzeichen" column="vfAkzV" />
			<key-property name="nummer" column="vfVfNr" length="6" />
		</composite-id>

		<many-to-one name="kunde" cascade="evict" fetch="select" not-null="true" lazy="false" not-found="keep">
			<formula>vfMand</formula>
			<column name="vfAkzD" />
			<column name="vfKdNr" />
		</many-to-one>
	</class>
If property kunde was changed and the entity is being updated, the where clause would have been:
vfMand = ? and vfAkzV = ? and vfVfNr = ? and null = ? and vfAkzD = ? and vfKdNr = ?
Clearly, the null is wrong!

Extent:
src/org/hibernate/persister/entity/AbstractEntityPersister.java


-- 
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