-->
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: <union-subclass> does not propagate indexes
PostPosted: Wed Apr 13, 2005 11:53 am 
Newbie

Joined: Tue Apr 12, 2005 4:00 pm
Posts: 3
Version: 3.0 (31.03.2005)

Use Case: My object model is broad, with a limited set of common fields, so I want to use table-per-concrete-class rather than table-per-class-hierarchy. However, I have queries on some of those common fields, so want them indexed in the database for all tables.

Mapping File:
Code:
<hibernate-mapping>
    <class name="dao.BaseClass">
        <id name="id" unsaved-value="null" column="ID">
            <generator class="native"/>
            </id>
        <property name="strval" type="string" length="16">
            <column name="STR_VAL" index="idx_baseclass_strval"/>
            </property>
       
        <union-subclass name="dao.ChildClass">
            <property name="datval" type="timestamp"/>
           
            <union-subclass name="dao.GrandchildClass">
                <property name="zippy" type="string" length="16"/>       
            </union-subclass>
        </union-subclass>
    </class>
</hibernate-mapping>


The generated SQL creates an index on BaseClass (STR_VAL), but not on ChildClass(STR_VAL) or GrandchildClass(STR_VAL).

Examining the SQL generation code, this appears to be intentional: DenormalizedTable does not override getIndexIterator() and Index.sqlCreateString() does not take a parameter for indexed table.

My question: is this an oversight that will be corrected in a future release, or is it intentional? I realize that there are a lot of special cases regarding index naming (eg, Oracle scopes names by schema, while Sybase/SQL-Server scopes them by table). For our case, I plan to enable index propagation using Oracle-style conventions, but this is a bit of a hack.


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.