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