[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5605) Conflicting aliases when properties have same name and different types in inheritance.

Ludger Springmann (JIRA) noreply at atlassian.com
Thu Sep 30 04:09:04 EDT 2010


Conflicting aliases when properties have same name and different types in inheritance.
--------------------------------------------------------------------------------------

                 Key: HHH-5605
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5605
             Project: Hibernate Core
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 3.2.6
         Environment: Hibernate 3.2.6, DB2 9.5 LUW on Solaris
            Reporter: Ludger Springmann
         Attachments: TestCase.zip

A Hql-Query leads to a DB2 Error (Error-Code -415). This happens with the following mapping:

In the sample testcase - that I added - there is an abstract superclass (AEntity) with two subclasses (BEntity, CEntity). BEntity has two numeric fields A and B. CEntity has two string fields B and C. When querying the HQL "from hibernate.testcase.inheritance.AEntity" this leads to the DB2-Error -415 (SQL0415N The data types of corresponding columns are not compatible in a fullselect that includes a set operator or in the multiple rows of a VALUES clause of an INSERT or fullselect.).

Here is the resulting SQL:

select aentity0_.Oid as Oid0_, aentity0_.A as A1_, aentity0_.B as B1_, aentity0_.B as B2_, aentity0_.C as C2_, aentity0_.clazz_ as clazz_ from ( select B, nullif('x','x') as C, Oid, A, 1 as clazz_ from springma.B union all select B, C, Oid, nullif(0,0) as A, 2 as clazz_ from springma.C ) aentity0_

In the union all both columns B are mapped into the same selection column. This is a type conflict.

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