Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5
I have problem that left outer joins are generated instead of inner joins. I have following 4 objects:
Party - AccountPartyRelation - Account - AccountYTurnOver
I'm accesing AccountPartyRelations from Party and I want that all accounts are loaded at the same time. I'am not using Query but traversing through associations defined in mapping files. I have correct mapping files, changed lazy to false, used fetch="join" and Hibernate generates corretly joins between AccountPartyRelation-Account-AccountYTurnOver. Join between AccountPartyRelation-Account is correctly inner join
but join between Account-AccountYTurnOver is left outer join. I have correctly set the one-to-one association between Account-AccountYTurnOver to not-null="true" so there is no problem to generate inner join.
I have found out that the problem is in OuterJoinLoader.getJoinType(boolean nullable, int currentDepth) where is comment
//TODO: this is too conservative; if all preceding joins were
// also inner joins, we could use an inner join here
I have changed the code that it does not check if currentDepth is 0 for inner joins but for our production I need some more official patch to Hibernate.
First: I don't know if it is really a bug or it belongs to wish list. Should I put it into JIRA?
Second: Is there any possibility that it could be fixed/implemented until the end of year 2005?