-->
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.  [ 6 posts ] 
Author Message
 Post subject: limit number of joins for use with mysql?
PostPosted: Thu Sep 04, 2003 3:40 am 
Newbie

Joined: Thu Sep 04, 2003 3:36 am
Posts: 11
Location: Karlsruhe/Germany
hi,

is there a way to limit the number of tables used in hibernate-generated joins?
we are using hibernate 2 with mysql 4.1a and it sometimes says
"Too many tables. MySQL can only use 31 tables in a join"

kind regards
philipp


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 3:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hibernate 2.1 has a new config property called:


hibernate.max_fetch_depth


which can be used to limit how deep outerjoin fetching goes by default.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 5:00 am 
Newbie

Joined: Thu Sep 04, 2003 3:36 am
Posts: 11
Location: Karlsruhe/Germany
thanks gavin,
i've tried version 2.1 but now our subclass-mappings don't work anymore.
hibernate says
'Repeated column in mapping for class <fill in subclass-name here> should be mapped with insert="false" update="false"' while initializing and i can't find any information on that.

philipp


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 5:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Do as it says! Use insert="false" update="false" to prevent repeated columns in an SQL INSERT/UPDATE.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 8:02 am 
Newbie

Joined: Thu Sep 04, 2003 3:36 am
Posts: 11
Location: Karlsruhe/Germany
Perhaps i have to change the subject to "stupid subclass question" now but i didn't get it yet.
We use XDoclet to generate the mapping documents. It worked fine with version 2.0.1 but version 2.1 doesn't accept the subclass-mappings:

Code:
<hibernate-mapping>
    <class
        name="ClassA"
        table="TEXT"
        dynamic-update="false"
        dynamic-insert="false"
        discriminator-value="DISC_A"
    >

        <id
           ...
        </id>

        <discriminator
            column="TYPE"
            type="string"
            length="30"
        />

        <property
            name="propX"
            type="string"
            column="PROP_X"
            length="2"
        />

        <property
            name="propY"
            type="string"
            column="PROP_Y"
            length="3"
        />

        <property
         ...
        />

        <subclass
            name="ClassB"
            dynamic-update="false"
            dynamic-insert="false"
            discriminator-value="DISC_B"
        >

        </subclass>
        <subclass
            name="ClassC"
            dynamic-update="false"
            dynamic-insert="false"
            discriminator-value="DISC_C"
        >

        ...


So please give me a hint what to change in the mapping documents.

Thanks
Philipp


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 8:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Not on the <subclass> elements!

On the <property> with the repeated column mapping!


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

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.