Hey all. First let me say I'm only posting as a last resort; I've spent hours googling, searching the forums, searching through the hibernate source, and methodically trying stuff out in my own project.
So I've got a class hierarchy mapped w/ @Inheritance(strategy=InheritanceType.JOINED) which really does make sense as a hierarchy; one of the main requirements is that I need to be able to query the whole hierarchy and add new concrete classes later without sever modifications to the data model. But when selecting from the top-level class it of course selects from all the tables using one big query, 1000+ columns, and 56 outer joins. Just recently I added a new concrete type to the hierarchy and it pushed Oracle over the column/join limit. Before where it may have been slow it now just fails completely when loading entities. This only happens in the edge cases as we've already optimized the heck out of the application when selecting from the hierarchy in the common cases.
So my question: Is it possible to use JOINED inheritance mapping and use sequential select rather than a massive join?
I have looked into using single-table but the problem is that: * you have to specify the table name for each column in the concrete class and we have a LOT of colums * we have mapped superclasses between the top-level class (which has a table) and the concrete tables
I could really use some help on this one.
FYI, I'm using the latest versions of core and annotations and am using only annotations (so far).
|