Hi All,
I searched in the existing topics for the answer, but not found any usable solution, that's why I opened this one.
The context of the problem:
I develop a system (JBoss AS 4.0.5, Java 1.5, EJB3, PostgreSQL 8.2) which (once it will be ready) makes possible to the end user to define entities and their relationships (e.g. one entity can be the property of an other), and this relationship can be 1-1, 1-n, polymorphic, etc. The defined entity-hierarchies are then stored in RDBMS.
The problem arises, when there are "much" entities and "much" relationships among the entities. (much==over 30 entity types).
When try to get the entity instance out of the DB, Hibernate generate one ~180KB length of SQL query, which is not parseable by the DB. (e.g. there are more than 5000 column names in the query since Hibernate uses JOIN for all the affected tables, whereas PostgreSQL has a 1664 field count limit for SELECTs).
I use InheritanceType.JOINED inheritance strategy ( I'm afraid of InheritanceType.TABLE_PER_CLASS would result the same).
The aim would be to instruct Hibernate somehow to not to fetch the entities with one "monolithic" query, but slice it up to more manageable parts. Or, if it is not possible, then how can this be controlled manually?
Any help would be appreciated.
Thank you,
Istvan
|