
|
If you were logged in you would be able to see more operations.
|
|
|
Hibernate Core
Created: 18/Apr/05 11:31 PM
Updated: 19/Apr/05 07:39 PM
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
3.0.1
|
|
|
When I try to delete a subclass entity, the resulting SQL is bad; it appears to be assuming an alias is being used when it isn't.
Mapping file (partial):
<hibernate-mapping>
<class name="com.wotif.jaguar.domain.Comment"
table="COMMENTS" dynamic-update="false" dynamic-insert="false"
select-before-update="false" optimistic-lock="version"
discriminator-value="null" >
...
<subclass
name="com.wotif.jaguar.domain.property.PropertyComment"
dynamic-update="false"
dynamic-insert="false"
discriminator-value="0"
>
...
</class>
</hibernate-mapping>
19/04/2005 14:25:20 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: HQL: delete from com.wotif.jaguar.domain.property.PropertyComment
19/04/2005 14:25:20 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: SQL: delete from COMMENTS where propertyco0_.CommentType=0
Under Hibernate 2.1.6, the generated SQL was:
delete from COMMENTS propertyco0_ where propertyco0_.CommentType = 0
My guess: the change to remove aliasing for update/deletes caused this to break.
|
|
Description
|
When I try to delete a subclass entity, the resulting SQL is bad; it appears to be assuming an alias is being used when it isn't.
Mapping file (partial):
<hibernate-mapping>
<class name="com.wotif.jaguar.domain.Comment"
table="COMMENTS" dynamic-update="false" dynamic-insert="false"
select-before-update="false" optimistic-lock="version"
discriminator-value="null" >
...
<subclass
name="com.wotif.jaguar.domain.property.PropertyComment"
dynamic-update="false"
dynamic-insert="false"
discriminator-value="0"
>
...
</class>
</hibernate-mapping>
19/04/2005 14:25:20 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: HQL: delete from com.wotif.jaguar.domain.property.PropertyComment
19/04/2005 14:25:20 org.hibernate.hql.ast.QueryTranslatorImpl generate FINE: SQL: delete from COMMENTS where propertyco0_.CommentType=0
Under Hibernate 2.1.6, the generated SQL was:
delete from COMMENTS propertyco0_ where propertyco0_.CommentType = 0
My guess: the change to remove aliasing for update/deletes caused this to break. |
Show » |
|
This has been fixed in CVS for almost 3 weeks now. Fixes released in 3.0.1.