Hi,
I also had this exact problem. My one-to-one relationship between Customer and Address was optional but because the query generated by hibernate was using inner join between CUSTOMER and ADDRESS table, it was not returning the CUSTOMER records that did not have the corresponding record in the ADDRESS table. I tried many changes in the hibernate mapping configuration for this relationship but nothing helped.
The way I could solve the issue in my case was that when I create an alias for the association customer.address, I use the class org.hibernate.Criteria 's method "createAlias(
String associationPath, String alias, int joinType)" and pass it explicitly the join type that I require. So I passed the join type flag org.hibernate.sql.JoinFragment.LEFT_OUTER_JOIN and it started using left outer join between customer and address tables in the query it generates and started returning customers without address records.
Hope you can apply this or some similar approach in your case.
Regards,
Roshan Dawrani