-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Property overloading ?
PostPosted: Mon Nov 15, 2004 6:53 am 
Newbie

Joined: Tue Oct 05, 2004 5:53 am
Posts: 1
Hibernate version: 2.1.6

Mapping documents:
Code:
<hibernate-mapping package="example">
   <class name="MyObject" table="OBJECTS">
      <id
         column="OBJ_ID"
         name="id"
         type="integer"
      >
         <generator class="vm" />
      </id>
      <property
         column="OBJ_NAME"
         length="150"
         name="name"
         not-null="false"
         type="string"
       />
      <joined-subclass name="Instrument" table="INSTRUMENTS">
         <key column="INT_ID" />
                  <property
         column="INT_NAME"
         length="150"
         name="name"
         not-null="false"
         type="string"
              />
            </joined-subclass>
          </class>
</hibernate-mapping>


Name and version of the database you are using:
Oracle 8.1.7

The generated SQL (show_sql=true):
Code:
SELECT instrument0_.obj_name AS x0_0_
  FROM INSTRUMENTS instrument0_, OBJECTS instrument0__1_
WHERE instrument0_.roo_id = instrument0__1_.obj_id


HQL sent
Code:
select int.name
from Instrument int


As you can see the SQL can't work because it uses the wrong column name on the wrong table.

I know I should just remove the property on Instrument but it was used in the legacy schema and it still need to be updated. And it could improve query performance (this HQL could use only INSTRUMENT and not even join with OBJECTS)

Is this a known bug ? Any workaround ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.