I have encountered the same problem. Please note that the issue occures only for default FetchMode which is JOIN. Please note that when you explicitly specify fetch mode as select @Fetch(FetchMode.SELECT) in your @ManyToOne relationship the correct query is generated e.g.: @ManyToOne @JoinColumn(name = "LEG_MATERIAL") @Fetch(FetchMode.SELECT) public MaterialType getLegsMaterial() { return legsMaterial; }
Please find also attached entire project with test cases which shows this behaviour.
|