Two Laptop Bag*
The moose likes Object Relational Mapping and the fly likes Need help with outer join in Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Need help with outer join in Hibernate" Watch "Need help with outer join in Hibernate" New topic
Author

Need help with outer join in Hibernate

Steve Vittoria
Ranch Hand

Joined: Jan 12, 2005
Posts: 33

Hi everyone,

I'm joining two tables, Document table and oword_Service_Code table on the column called service_code. The thing is that I can have a service_code that exists in the document table but not in the oword_Service_Code table. This is causing me to get javax.persistence.EntityNotFoundException errors.

This is how I'm joining the two tables...


Should I be adding some annotation that would avoid this error?

Thanks!
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1650
    
    7

have a look at the nullable=true attribute


[How To Ask Questions][Read before you PM me]
Steve Vittoria
Ranch Hand

Joined: Jan 12, 2005
Posts: 33

I tried doing the following...



but I still get javax.persistence.EntityNotFoundException error.

I also tried adding optional = true to @ManyToOne, but still the same error.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1650
    
    7

This applicable to your situation?
https://community.jboss.org/message/522967

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with outer join in Hibernate