I created Hibernate entity classes from NetBeans master. All works Ok except if I open detail entity by HQL then master will be empty (all fields will be null, '' or 0). I use Hibernate 4.3. Example: in master (DealerMain): @OneToMany(fetch=FetchType.LAZY, mappedBy="dealerMain") public Set<AccountMain> getAccountMains() { return this.accountMains; }
in detail (AccountMain): @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="GroupID", nullable=false) public DealerMain getDealerMain() { return this.dealerMain; }
If I open AccountMain by HQL then all fields in AccountMain.getDealerMain() will be empty. SQL operator right. But if I'll open before DealerMain (dealer of the account) then dealerMain will be right. I looked in debugger what wrong master if used Hibernate generated class derived from DealerMain. Any suggestions?
Thanks, Haim Fridland.
|