-->
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.  [ 3 posts ] 
Author Message
 Post subject: Querying on the base class as opposed to the derived
PostPosted: Fri Feb 27, 2004 2:24 pm 
Newbie

Joined: Tue Nov 04, 2003 7:44 am
Posts: 4
Location: London
Hello,

My using Hibernate version 2.0 and mySQL Ver 11.18.

My mapping file it too big to post here, but I think it is not necessary. I have been using a very big hierachy (100+ classes) of joined-subclasses. For simplicity, let's say that the base class is A and Z is one of the derived classes further down the hierarchy (indirectly derived from A).

The query "from Z where id = 10" works fine, but the setting:

Quote:
hibernate.use_outer_join false


is necessary to prevent mySQL from joining more than 31 tables (that's its limit).

I have a situation where I only know the id and not the classname. If I try "from A where id = 10", I get a huge query that (probably) joins all the tables of the database. And i get the following exception:
Quote:
27-Feb-2004 18:18:03 net.sf.hibernate.JDBCException <init>
SEVERE: Could not execute query
java.sql.SQLException: General error, message from server: "Too many tables. MySQL can only use 31 tables in a join"


Is there any setting/solution to allow this kind of query to be broken to smaller queries? I have already set

Quote:
hibernate.dialect net.sf.hibernate.dialect.MySQLDialect


Thanks

_________________
Stathis Sideris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2004 3:25 pm 
Newbie

Joined: Tue Aug 26, 2003 12:31 pm
Posts: 14
Right from the FAQ page:

You can set outer-join="false" on associations or, in Hibernate 2.1, use hibernate.max_fetch_depth.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 3:56 pm 
Newbie

Joined: Tue Nov 04, 2003 7:44 am
Posts: 4
Location: London
meagle wrote:
Right from the FAQ page:

You can set outer-join="false" on associations or, in Hibernate 2.1, use hibernate.max_fetch_depth.


Well my problem is not associations (which work fine) but deep hierarchy! It seems that hibernate ignores the outer-join false setting for this kind of query. I wonder if it is because of the nature of the query and it can't be executed differently. Does anyone know?

_________________
Stathis Sideris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.